

#ifdef INCLUDE_PNEU_TEST

#include  <typedefs.h>
#include  <p_wkfile.h>
#include  <wkfile.h>
#include  <ramps.h>
#include  <zone_config.h>
#include  <zone_status.h>
#include  <p_status.h>
#include  <status.h>
#include  <error.h>
#include  <p_ui.h>
#include  <stddef.h>
#include  <list_mgmt.h>
#include  <display.h>
#include <mio.h>
#include <cmd_set.h>
#include <method.h>
#include <hostutil.h>
#include <i_op.h>
#include <std_ops.h>
#include <task_pub.h>
#include <exception.h>
#include <err_handler.h>
#include <keyboard.h>
#include <zone_ui.h>
#include <run_ui.h>
#include "proto.h"

/* test entry definition */
typedef struct {
                 struct {
                         unsigned cmd_tag     : 8;
                         unsigned obj         : 8;
                         unsigned setpt_tag   : 8;
                         unsigned enum_type   : 8;
                   }   bits;
                 float value; } CMD_ENTRY, *pCMD_ENTRY;

typedef struct {
          BIT8     *tag_name;
          U_INT16   tag_value;
          U_INT8    enum_type;
        } DEF, *pDEF;

static float    a, b, c, d, temp, test_num;
static UI_ERR   error;
static U_INT16  pc, step_num;
static BIT8     ne, eq, gt, lt, ok, ignore;
static pCMD_ENTRY script_ptr;
static U_INT8   test_state, bounds;
static U_INT16  test,step;


#pragma SECTION DATA=tcomp

CMD_ENTRY Test_Buffer[ 1024 ];

#pragma SECTION UNDO


/* get function prototypes */

typedef U_INT8  (*GET_B)( );
typedef U_INT16 (*GET_W)( );
typedef U_INT32 (*GET_L)( );

typedef U_INT8  (*GET_B_P)( void *ptr );
typedef U_INT16 (*GET_W_P)( void *ptr );
typedef U_INT32 (*GET_L_P)( void *ptr );

typedef U_INT8  (*GET_B_PN)( void *ptr, U_INT8 num );
typedef U_INT16 (*GET_W_PN)( void *ptr, U_INT8 num );
typedef U_INT32 (*GET_L_PN)( void *ptr, U_INT8 num );

typedef U_INT8  (*GET_B_NP)( U_INT8 num, void *ptr );
typedef U_INT16 (*GET_W_NP)( U_INT8 num, void *ptr );
typedef U_INT32 (*GET_L_NP)( U_INT8 num, void *ptr );

/* set function prototypes */

typedef UI_ERR  (*SET_P)( void *ptr     );
typedef UI_ERR  (*SET_B)( U_INT8  value );
typedef UI_ERR  (*SET_W)( U_INT16 value );
typedef UI_ERR  (*SET_L)( U_INT32 value );

typedef UI_ERR  (*SET_PB)( void *ptr, U_INT8  value );
typedef UI_ERR  (*SET_PW)( void *ptr, U_INT16 value );
typedef UI_ERR  (*SET_PL)( void *ptr, U_INT32 value );

typedef UI_ERR  (*SET_BP)( U_INT8  value , void *ptr);
typedef UI_ERR  (*SET_WP)( U_INT16 value , void *ptr);
typedef UI_ERR  (*SET_LP)( U_INT32 value , void *ptr);

typedef UI_ERR  (*SET_PBN)( void *ptr,    U_INT8  value, U_INT8 num   );
typedef UI_ERR  (*SET_PWN)( void *ptr,    U_INT16 value, U_INT8 num   );
typedef UI_ERR  (*SET_PLN)( void *ptr,    U_INT32 value, U_INT8 num   );

typedef UI_ERR  (*SET_PNB)( void *ptr,    U_INT8 num,    U_INT8  value );
typedef UI_ERR  (*SET_PNW)( void *ptr,    U_INT8 num,    U_INT16 value );
typedef UI_ERR  (*SET_PNL)( void *ptr,    U_INT8 num,    U_INT32 value );

typedef UI_ERR  (*SET_NPB)( U_INT8 num,   void *ptr,     U_INT8  value );
typedef UI_ERR  (*SET_NPW)( U_INT8 num,   void *ptr,     U_INT16 value );
typedef UI_ERR  (*SET_NPL)( U_INT8 num,   void *ptr,     U_INT32 value );

typedef UI_ERR  (*SET_BPN)( U_INT8  value,   void *ptr,  U_INT8 num    );
typedef UI_ERR  (*SET_WPN)( U_INT16 value,   void *ptr,  U_INT8 num    );
typedef UI_ERR  (*SET_LPN)( U_INT32 value,   void *ptr,  U_INT8 num    );

typedef UI_ERR  (*SET_BNP)( U_INT8  value, U_INT8 num,   void *ptr     );
typedef UI_ERR  (*SET_WNP)( U_INT16 value, U_INT8 num,   void *ptr     );
typedef UI_ERR  (*SET_LNP)( U_INT32 value, U_INT8 num,   void *ptr     );

typedef UI_ERR  (*SET_NBP)( U_INT8 num, U_INT8  value,   void *ptr     );
typedef UI_ERR  (*SET_NWP)( U_INT8 num, U_INT16 value,   void *ptr     );
typedef UI_ERR  (*SET_NLP)( U_INT8 num, U_INT32 value,   void *ptr     );


/* get/set call combinations */

#define None         0
#define Val          1
#define Val_Ptr      2
#define Ptr_Val      3
#define Ptr_Val_Num  4
#define Ptr_Num_Val  5
#define Num_Ptr_Val  6
#define Val_Ptr_Num  7
#define Val_Num_Ptr  8
#define Num_Val_Ptr  9
#define Ptr          10
#define Ptr_Num      11
#define Num_Ptr      12


typedef struct {
         void   *func_name;
         U_INT8  parm_size;
         U_INT8  parm_ordering;

        } FUNC_DESC, *pFUNC_DESC;


typedef struct {

        FUNC_DESC   Get;
        FUNC_DESC   Set;
        FUNC_DESC   DcGet;
        FUNC_DESC   DcSet;

        float       Scaling;
        float       Dc_Scaling;
        float       Dc_Modulo;

        char        *Name;

       } SETPT_DESC;





static const SETPT_DESC Setpts[] =
{

#define aux_pres_actual 0

  {{ (void *)(long)GetAuxPresActual,             4, Ptr        },
   { (void *)(long)(void *) 0,                   0, 0          },
   { (void *)(long)DcGetAuxPresActual,           4, Ptr        },
   { (void *)(long)(void *) 0,                   0, 0          },
     10, 68947.57, 160, "aux pres actual" },



#define aux_pres 1

   {{ (void *)(long)GetAuxPresSetpt,              4, Ptr        },
    { (void *)(long)SetAuxPresSetpt,              4, Val_Ptr    },
    { (void *)(long)DcGetAuxPresSetpt,            4, Ptr        },
    { (void *)(long)DcSetAuxPresSetpt,            4, Val_Ptr    },
     10, 68947.57, 160, "aux pres setpt" },



#define aux_state 2

   {{ (void *)(long)GetAuxWkfileState,            1, Ptr        },
    { (void *)(long) SetAuxState,                 1, Val_Ptr    },
    { (void *)(long)GetAuxWkfileState,            1, Ptr        },
    { (void *)(long) SetAuxState,                 1, Val_Ptr    },
     1,  1,      1,   "aux state" },


#define aux_max_pres 3

   {{ (void *)(long)GetAuxMaxPres,                4, Ptr        },
    { (void *)(long)(void *) 0,                   4, Val_Ptr    },
    { (void *)(long)DcGetAuxMaxPres,              4, Ptr        },
    { (void *)(long)(void *) 0,                   4, Val_Ptr    },
     10,  68947.57,      160,   "aux max pres" },


#define aux_gas_type 4

   {{ (void *)(long)GetAuxGasType,                1, Ptr        },
    { (void *)(long) SetAuxGasType,               1, Val_Ptr    },
    { (void *)(long)GetAuxGasType,                1, Ptr        },
    { (void *)(long) SetAuxGasType,               1, Val_Ptr    },
     1,  1,      1,   "aux gas type" },


#define aux_init_pres 5

   {{ (void *)(long)GetAuxInitPres,               4, Ptr        },
    { (void *)(long)SetAuxInitPres,               4, Ptr_Val    },
    { (void *)(long)DcGetAuxInitPres,             4, Ptr        },
    { (void *)(long)DcSetAuxInitPres,             4, Ptr_Val    },
     10,  68947.57,    160,   "aux init pres" },


#define aux_pres_rate 6

   {{ (void *)(long)GetAuxPresRate,               4, Ptr_Num     },
    { (void *)(long)SetAuxPresRate,               4, Ptr_Val_Num },
    { (void *)(long)DcGetAuxPresRate,             4, Ptr_Num     },
    { (void *)(long)DcSetAuxPresRate,             4, Ptr_Val_Num },
     100,  68947.57,    160,   "aux pres rate" },


#define aux_final_pres  7

   {{ (void *)(long)GetAuxPresFinalVal,           4, Ptr_Num     },
    { (void *)(long)SetAuxPresFinalVal,           4, Ptr_Val_Num },
    { (void *)(long)DcGetAuxPresFinalVal,         4, Ptr_Num     },
    { (void *)(long)DcSetAuxPresFinalVal,         4, Ptr_Val_Num },
     10,  68947.57,    160,   "aux final pres" },


#define aux_init_time 8

   {{ (void *)(long)GetAuxPresInitTime,           4, Ptr         },
    { (void *)(long)SetAuxPresInitTime,           4, Ptr_Val     },
    { (void *)(long)DcGetAuxPresInitTime,         4, Ptr         },
    { (void *)(long)DcSetAuxPresInitTime,         4, Ptr_Val     },
     100,  100,    1,   "aux init time" },


#define aux_final_time  9

   {{ (void *)(long)GetAuxPresFinalTime,          4, Ptr_Num     },
    { (void *)(long)SetAuxPresFinalTime,          4, Ptr_Val_Num },
    { (void *)(long)DcGetAuxPresFinalTime,        4, Ptr_Num     },
    { (void *)(long)DcSetAuxPresFinalTime,        4, Ptr_Val_Num },
     100,  100,    1,   "aux final time" },


#define aux_equib_time     10

   {{ (void *)(long)GetAuxPresEquibTime,          4, Ptr         },
    { (void *)(long)SetAuxPresEquibTime,          4, Val_Ptr     },
    { (void *)(long)DcGetAuxPresEquibTime,        4, Ptr         },
    { (void *)(long)DcSetAuxPresEquibTime,        4, Val_Ptr     },
     100,  100,    1,   "aux equib time" },



#define col_ramp_type      11

   {{ (void *)(long)GetColumnRampType,            1, Ptr         },
    { (void *)(long)0,                            1, Val_Ptr     },
    { (void *)(long)GetColumnRampType,            1, Ptr         },
    { (void *)(long)0,                            1, Val_Ptr     },
     1,  1,    1,   "col ramp type" },



#define col_diam           12

   {{ (void *)(long)GetColumnDiam,                4, Ptr         },
    { (void *)(long)SetColumnDiam,                4, Val_Ptr     },
    { (void *)(long)GetColumnDiam,                4, Ptr         },
    { (void *)(long)DcSetColumnDiam,              4, Val_Ptr     },
     1,  1,    1,   "col diam " },


#define col_length           13

   {{ (void *)(long)GetColumnLength,              4, Ptr         },
    { (void *)(long)SetColumnLength,              4, Val_Ptr     },
    { (void *)(long)GetColumnLength,              4, Ptr         },
    { (void *)(long)DcSetColumnLength,            4, Val_Ptr     },
     100,  100,    1,   "col length " },


#define col_film_thickness           14

   {{ (void *)(long)GetColumnFilmThickness,       4, Ptr         },
    { (void *)(long)SetColumnFilmThickness,       4, Val_Ptr     },
    { (void *)(long)GetColumnFilmThickness,       4, Ptr         },
    { (void *)(long)DcSetColumnFilmThickness,     4, Val_Ptr     },
     100,  100,    1,   "col film thickness " },


#define col_source           15

   {{ (void *)(long)GetColumnSource,              1, Ptr         },
    { (void *)(long)SetColumnSource,              1, Val_Ptr     },
    { (void *)(long)GetColumnSource,              1, Ptr         },
    { (void *)(long)DcSetColumnSource,            1, Val_Ptr     },
     1,  1,    1,   "col source" },


#define col_vacuum_comp      16

   {{ (void *)(long)GetColumnVacuumComp,          1, Ptr         },
    { (void *)(long)SetColumnVacuumComp,          1, Val_Ptr     },
    { (void *)(long)GetColumnVacuumComp,          1, Ptr         },
    { (void *)(long)SetColumnVacuumComp,          1, Val_Ptr     },
     1,  1,    1,   "col vacuum comp " },


#define col_pres_comp        17

   {{ (void *)(long)ColumnOutletPresCompEnabled,  1, Ptr         },
    { (void *)(long)SetColumnOutletPresComp,      1, Val_Ptr     },
    { (void *)(long)ColumnOutletPresCompEnabled,  1, Ptr         },
    { (void *)(long)SetColumnOutletPresComp,      1, Val_Ptr     },
     1,  1,    1,   "col outlet pres comp" },


#define col_pres_comp_setpt  18

   {{ (void *)(long)GetColumnOutletPresCompSetpt,   4, Ptr         },
    { (void *)(long)SetColumnOutletPresCompSetpt,   4, Val_Ptr     },
    { (void *)(long)DcGetColumnOutletPresCompSetpt, 4, Ptr         },
    { (void *)(long)DcSetColumnOutletPresCompSetpt, 4, Val_Ptr     },
     10,  68947.57,    160,   "col outlet pres comp setpt" },


#define col_max_pres_comp_setpt  19

   {{ (void *)(long)GetMaxColPresComp,              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10,  68947.57,    160,   "col max outlet pres comp setpt" },


#define col_head_pres            20

   {{ (void *)(long)GetColumnHeadPres,              4, Ptr         },
    { (void *)(long)SetColumnHeadPres,              4, Val_Ptr     },
    { (void *)(long)DcGetColumnHeadPres,            4, Ptr         },
    { (void *)(long)DcSetColumnHeadPres,            4, Val_Ptr     },
     10,  68947.57,    160,   "col head pres" },


#define col_vflow                21

   {{ (void *)(long)GetColumnVFlow,                 4, Ptr         },
    { (void *)(long)SetColumnVFlow,                 4, Val_Ptr     },
    { (void *)(long)DcGetColumnVFlow,               4, Ptr         },
    { (void *)(long)DcSetColumnVFlow,               4, Val_Ptr     },
     10,     1000,    100,   "col vflow" },


#define col_avg_velocity         22

   {{ (void *)(long)GetColumnAvgVelocity,           4, Ptr         },
    { (void *)(long)SetColumnAvgVel,                4, Val_Ptr     },
    { (void *)(long)DcGetColumnAvgVelocity,         4, Ptr         },
    { (void *)(long)DcSetColumnAvgVel,              4, Val_Ptr     },
     10,     1000,    100,   "col vflow" },


#define col_vflow_actual         23

   {{ (void *)(long)GetColumnVFlowActual,           4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)DcGetColumnVFlowActual,         4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10,     1000,    100,   "col vflow actual" },


#define col_control_mode         24

   {{ (void *)(long)GetColumnControlMode,           1, Ptr         },
    { (void *)(long)SetColumnControlMode,           1, Val_Ptr     },
    { (void *)(long)GetColumnControlMode,           1, Ptr         },
    { (void *)(long)SetColumnControlMode,           1, Val_Ptr     },
     1,     1,    1,   "col control mode" },


#define col_post_pres            25

   {{ (void *)(long)GetColumnPostPres,              4, Ptr         },
    { (void *)(long)SetColumnPostPres,              4, Val_Ptr     },
    { (void *)(long)DcGetColumnPostPres,            4, Ptr         },
    { (void *)(long)DcSetColumnPostPres,            4, Val_Ptr     },
     10, 68947.57,    160,   "col post pres" },


#define col_post_flow            26

   {{ (void *)(long)GetColumnPostFlow,              4, Ptr         },
    { (void *)(long)SetColumnPostFlow,              4, Val_Ptr     },
    { (void *)(long)DcGetColumnPostFlow,            4, Ptr         },
    { (void *)(long)DcSetColumnPostFlow,            4, Val_Ptr     },
     10, 1000,    1,   "col post flow" },


#define col_source_state         27

   {{ (void *)(long)GetColumnSourceState,           1, Ptr         },
    { (void *)(long)SetColumnSourceState,           1, Val_Ptr     },
    { (void *)(long)GetColumnSourceState,           1, Ptr         },
    { (void *)(long)SetColumnSourceState,           1, Val_Ptr     },
     1, 1,    1,   "col source state" },


#define col_source_max_pres            28

   {{ (void *)(long)GetColumnSourceState,           1, Ptr         },
    { (void *)(long)0,                              1, Val_Ptr     },
    { (void *)(long)0,                              1, Ptr         },
    { (void *)(long)0,                              1, Val_Ptr     },
     10, 1,    1,   "col source max pres" },


#define col_source_max_flow            29

   {{ (void *)(long)GetColumnSourceState,           1, Ptr         },
    { (void *)(long)0,                              1, Val_Ptr     },
    { (void *)(long)0,                              1, Ptr         },
    { (void *)(long)0,                              1, Val_Ptr     },
     10, 1,    1,   "col source max_flow" },


#define col_calib_mode                 30

   {{ (void *)(long)GetColumnCalibMode,             1, Ptr         },
    { (void *)(long)SetColumnCalibMode,             1, Ptr_Val     },
    { (void *)(long)DcGetColumnCalibMode,           1, Ptr         },
    { (void *)(long)DcSetColCalibMode,              1, Ptr_Val     },
     1, 1,    1,   "col calib mode" },


#define col_hold_time                  31

   {{ (void *)(long)GetColumnCalibHoldTime,         4, Ptr         },
    { (void *)(long)SetColumnCalibHoldTime,         4, Ptr_Val     },
    { (void *)(long)DcGetColumnCalibHoldTime,       4, Ptr         },
    { (void *)(long)DcSetColHoldTime,               4, Ptr_Val     },
     1000, 1000,    1,   "col hold time" },


#define col_meas_flow                  32

   {{ (void *)(long)GetColumnCalibMeasFlow,         4, Ptr         },
    { (void *)(long)SetColumnCalibMeasFlow,         4, Ptr_Val     },
    { (void *)(long)DcGetColMeasFlow,               4, Ptr         },
    { (void *)(long)DcSetColMeasFlow,               4, Ptr_Val     },
     10, 1000,    1,   "col meas flow" },


#define col_calib_length               33

   {{ (void *)(long)GetColumnCalibLength,           4, Ptr         },
    { (void *)(long)SetColumnCalibLength,           4, Ptr_Val     },
    { (void *)(long)DcGetColCalibLength,            4, Ptr         },
    { (void *)(long)DcAcceptCalibLength,            4, Ptr_Val     },
     10, 10,    1,   "col calib length" },


#define col_calib_diam                 34

   {{ (void *)(long)GetColumnCalibDiam,             4, Ptr         },
    { (void *)(long)SetColumnCalibDiam,             4, Ptr_Val     },
    { (void *)(long)DcGetColCalibDiam,              4, Ptr         },
    { (void *)(long)DcAcceptCalibDiam,              4, Ptr_Val     },
     10, 10,    1,   "col calib length" },


#define col_init_pres                  35

   {{ (void *)(long)GetColInitPres,                 4, Ptr         },
    { (void *)(long)SetColInitPres,                 4, Ptr_Val     },
    { (void *)(long)DcGetColInitPres,               4, Ptr         },
    { (void *)(long)DcSetColInitPres,               4, Ptr_Val     },
     10, 68947.57, 160,   "col init pres" },


#define col_init_time                  36

   {{ (void *)(long)GetColPresInitTime,             4, Ptr         },
    { (void *)(long)SetColPresInitTime,             4, Ptr_Val     },
    { (void *)(long)DcGetColPresInitTime,           4, Ptr         },
    { (void *)(long)DcSetColPresInitTime,           4, Ptr_Val     },
     100, 100, 1,   "col init time" },


#define col_pres_rate                  37

   {{ (void *)(long)GetColPresRate,                 4, Ptr_Num     },
    { (void *)(long)SetColPresRate,                 4, Ptr_Val_Num },
    { (void *)(long)DcGetColPresRate,               4, Ptr_Num     },
    { (void *)(long)DcSetColPresRate,               4, Ptr_Val_Num },
     100, 68947.57, 160,   "col pres rate" },


#define col_final_pres                 38

   {{ (void *)(long)GetColPresFinalVal,             4, Ptr_Num     },
    { (void *)(long)SetColPresFinalVal,             4, Ptr_Val_Num },
    { (void *)(long)DcGetColPresFinalVal,           4, Ptr_Num     },
    { (void *)(long)DcSetColPresFinalVal,           4, Ptr_Val_Num },
     10, 68947.57, 160,   "col final pres" },


#define col_final_time                 39

   {{ (void *)(long)GetColPresFinalTime,            4, Ptr_Num     },
    { (void *)(long)SetColPresFinalTime,            4, Ptr_Val_Num },
    { (void *)(long)DcGetColPresFinalTime,          4, Ptr_Num     },
    { (void *)(long)DcSetColPresFinalTime,          4, Ptr_Val_Num },
     100, 100, 1,   "col final time" },


#define col_init_flow                  40

   {{ (void *)(long)GetColInitFlow,                 4, Ptr         },
    { (void *)(long)SetColInitFlow,                 4, Ptr_Val     },
    { (void *)(long)DcGetColInitFlow,               4, Ptr         },
    { (void *)(long)DcSetColInitFlow,               4, Ptr_Val     },
     10, 1000, 1,   "col init flow" },


#define col_flow_rate                  41

   {{ (void *)(long)GetColFlowRate,                 4, Ptr_Num     },
    { (void *)(long)SetColFlowRate,                 4, Ptr_Val_Num },
    { (void *)(long)DcGetColFlowRate,               4, Ptr_Num     },
    { (void *)(long)DcSetColFlowRate,               4, Ptr_Val_Num },
     100, 1000, 1,   "col flow rate" },


#define col_final_flow                 42

   {{ (void *)(long)GetColFlowFinalVal,             4, Ptr_Num     },
    { (void *)(long)SetColFlowFinalVal,             4, Ptr_Val_Num },
    { (void *)(long)DcGetColFlowFinalVal,           4, Ptr_Num     },
    { (void *)(long)DcSetColFlowFinalVal,           4, Ptr_Val_Num },
     10, 1000, 1,   "col final flow" },


#define inlet_gas_type                 43

   {{ (void *)(long)GetInletGasType,                1, Ptr         },
    { (void *)(long)SetInletGasType,                1, Val_Ptr     },
    { (void *)(long)GetInletGasType,                1, Ptr         },
    { (void *)(long)GetInletGasType,                1, Val_Ptr     },
     1, 1, 1,   "inlet gas type" },


#define inlet_miser_mode               44

   {{ (void *)(long)GetInletMiserMode,              1, Ptr         },
    { (void *)(long)SetInletMiserMode,              1, Val_Ptr     },
    { (void *)(long)GetInletMiserMode,              1, Ptr         },
    { (void *)(long)SetInletMiserMode,              1, Val_Ptr     },
     1, 1, 1,   "inlet miser mode" },


#define det_flow                       45

   {{ (void *)(long)GetDetGasWkfileFlowSetpt,       4, Ptr_Num     },
    { (void *)(long)SetDetectorGasFlowSetpt,        4, Val_Ptr_Num },
    { (void *)(long)DcGetDetGasWkfileFlowSetpt,     4, Ptr_Num     },
    { (void *)(long)DcSetDetectorGasFlowSetpt,      4, Val_Ptr_Num },
     10, 1000, 1,   "det flow" },


#define det_state                      46

   {{ (void *)(long)GetDetGasWkfileState,           1, Ptr_Num     },
    { (void *)(long)SetDetGasState,                 1, Val_Ptr_Num },
    { (void *)(long)GetDetGasWkfileState,           1, Ptr_Num     },
    { (void *)(long)SetDetGasState,                 1, Val_Ptr_Num },
     1, 1, 1,   "det state" },


#define det_const_mug_mode             47

   {{ (void *)(long)GetDetConstMkupMode,            1, Ptr         },
    { (void *)(long)SetDetConstMkupMode,            1, Val_Ptr     },
    { (void *)(long)GetDetConstMkupMode,            1, Ptr         },
    { (void *)(long)SetDetConstMkupMode,            1, Val_Ptr     },
     1, 1, 1,   "det state" },


#define det_combo_flow                 48

   {{ (void *)(long)GetConstMakeupFlowSetpt,        4, Ptr         },
    { (void *)(long)SetConstMakeupFlowSetpt,        4, Val_Ptr     },
    { (void *)(long)DcGetConstMakeupFlowSetpt,      4, Ptr         },
    { (void *)(long)DcSetConstMakeupFlowSetpt,      4, Val_Ptr     },
     10, 1000, 1,   "det combo flow" },


#define det_gas_type                   49

   {{ (void *)(long)GetDetectorGasType,             1, Ptr_Num     },
    { (void *)(long)SetDetectorGasType,             1, Ptr_Num_Val },
    { (void *)(long)GetDetectorGasType,             1, Ptr_Num     },
    { (void *)(long)SetDetectorGasType,             1, Ptr_Num_Val },
     1, 1, 1,   "det gas type" },


#define det_type                       50

   {{ (void *)(long)GetDetType,                     1, Ptr         },
    { (void *)(long)0,                              1, Ptr_Num_Val },
    { (void *)(long)GetDetType,                     1, Ptr         },
    { (void *)(long)0,                              1, Ptr_Num_Val },
     1, 1, 1,   "det type" },


#define inlet_pres                     51

   {{ (void *)(long)GetInletPresSetpt,              4, Ptr         },
    { (void *)(long)SetInletPresSetpt,              4, Val_Ptr     },
    { (void *)(long)DcGetInletWkfilePresSetpt,      4, Ptr         },
    { (void *)(long)DcSetInletPresSetpt,            4, Val_Ptr     },
     10, 68947.57, 160,   "inlet pres" },


#define inlet_pres_immediate           52

   {{ (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)DcSetInletPresSetptImmediate,   4, Val_Ptr     },
     10, 68947.57, 160,   "inlet pres" },


#define inlet_flow                     53

   {{ (void *)(long)GetInletFlowSetpt,              4, Ptr         },
    { (void *)(long)SetInletFlowSetpt,              4, Val_Ptr     },
    { (void *)(long)DcGetInletWkfileFlowSetpt,      4, Ptr         },
    { (void *)(long)DcSetInletFlowSetpt,            4, Val_Ptr     },
     10, 1000, 1,  "inlet flow" },


#define inlet_flow_immediate           54

   {{ (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)DcSetInletFlowSetptImmediate,   4, Val_Ptr     },
     10, 1000, 1,  "inlet flow" },


#define inlet_inject_mode              55

   {{ (void *)(long)GetInletInjectMode,             1, Ptr         },
    { (void *)(long)SetInletInjectMode,             1, Val_Ptr     },
    { (void *)(long)GetInletInjectMode,             1, Ptr         },
    { (void *)(long)DcSetInletInjectMode,           1, Val_Ptr     },
     1, 1, 1,  "inlet inject mode" },


#define inlet_split_flow               56

   {{ (void *)(long)GetInletSplitFlow,              4, Ptr         },
    { (void *)(long)SetInletSplitFlow,              4, Val_Ptr     },
    { (void *)(long)DcGetInletSplitFlow,            4, Ptr         },
    { (void *)(long)DcSetInletSplitFlow,            4, Val_Ptr     },
     10, 1000, 1,  "inlet split flow" },


#define inlet_min_split_flow            57

   {{ (void *)(long)GetMinSplitFlow,                4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10, 1000, 1,  "inlet split flow" },


#define inlet_max_split_flow            58

   {{ (void *)(long)GetMaxSplitFlow,                4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10, 1000, 1,  "inlet split flow" },


#define inlet_max_total_flow            59

   {{ (void *)(long)GetMinTotalInletFlow,           4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10, 1000, 1,  "inlet split flow" },


#define inlet_miser_flow                60

   {{ (void *)(long)GetInletMiserFlow,              4, Ptr         },
    { (void *)(long)SetInletMiserFlow,              4, Val_Ptr     },
    { (void *)(long)DcGetInletMiserFlow,            4, Ptr         },
    { (void *)(long)DcSetInletMiserFlow,            4, Val_Ptr     },
     10, 1000, 1,  "inlet miser flow" },


#define inlet_min_miser_flow            61

   {{ (void *)(long)GetInletMinMiserFlow,           4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10, 1000, 1,  "inlet min miser flow" },


#define inlet_purge_flow                62

   {{ (void *)(long)GetInletPurgeFlow,              4, Ptr         },
    { (void *)(long)SetInletPurgeFlow,              4, Val_Ptr     },
    { (void *)(long)DcGetInletPurgeFlow,            4, Ptr         },
    { (void *)(long)DcSetInletPurgeFlow,            4, Val_Ptr     },
     10, 1000, 1,  "inlet purge flow" },


#define inlet_miser_time                63

   {{ (void *)(long)GetInletMiserTime,              4, Ptr         },
    { (void *)(long)SetInletMiserTime,              4, Val_Ptr     },
    { (void *)(long)GetInletMiserTime,              4, Ptr         },
    { (void *)(long)DcSetInletMiserTime,            4, Val_Ptr     },
     100, 100, 1,  "inlet miser time" },


#define inlet_purge_time                64

   {{ (void *)(long)GetInletPurgeTime,              4, Ptr         },
    { (void *)(long)SetInletPurgeTime,              4, Val_Ptr     },
    { (void *)(long)GetInletPurgeTime,              4, Ptr         },
    { (void *)(long)DcSetInletPurgeTime,            4, Val_Ptr     },
     100, 100, 1,  "inlet purge time" },


#define inlet_pulse_time                65

   {{ (void *)(long)GetPressurePulseTime,           4, Ptr         },
    { (void *)(long)SetPressurePulseTime,           4, Val_Ptr     },
    { (void *)(long)GetPressurePulseTime,           4, Ptr         },
    { (void *)(long)DcSetPressurePulseTime,         4, Val_Ptr     },
     100, 100, 1,  "inlet pulse time" },


#define inlet_pulse_pres                66

   {{ (void *)(long)GetPressurePulsePressure,       4, Ptr         },
    { (void *)(long)SetPressurePulsePressure,       4, Val_Ptr     },
    { (void *)(long)DcGetPressurePulsePressure,     4, Ptr         },
    { (void *)(long)DcSetPressurePulsePressure,     4, Val_Ptr     },
     10, 68947.57, 160,   "inlet pulse time" },


#define inlet_split_ratio               67

   {{ (void *)(long)GetInletSplitRatio,             4, Ptr         },
    { (void *)(long)SetInletSplitRatio,             4, Val_Ptr     },
    { (void *)(long)DcGetInletSplitRatio,           4, Ptr         },
    { (void *)(long)DcSetInletSplitRatio,           4, Val_Ptr     },
     10, 10000, 1,   "inlet split_ratio" },


#define inlet_min_split_ratio           68

   {{ (void *)(long)GetMinSplitRatio,               4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10, 10000, 1,   "inlet min split_ratio" },


#define inlet_max_split_ratio           69

   {{ (void *)(long)GetMaxSplitRatio,               4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Val_Ptr     },
     10, 10000, 1,   "inlet max split_ratio" },


#define inlet_state                     70

   {{ (void *)(long)GetInletWkfileState,            1, Ptr         },
    { (void *)(long)SetInletState,                  1, Val_Ptr     },
    { (void *)(long)GetInletWkfileState,            1, Ptr         },
    { (void *)(long)DcSetInletState,                1, Val_Ptr     },
     1, 1, 1,   "inlet state" },


#define inlet_type                      71

   {{ (void *)(long)GetInletType,                   1, Ptr         },
    { (void *)(long)SetInletType,                   1, Ptr_Val     },
    { (void *)(long)GetInletType,                   1, Ptr         },
    { (void *)(long)SetInletType,                   1, Ptr_Val     },
     1, 1, 1,   "inlet type" },


#define inlet_max_flow                  72

   {{ (void *)(long)GetInletMaxFlow,                4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
     10, 1, 1,   "inlet max pres" },


#define inlet_max_pres                  73

   {{ (void *)(long)GetInletMaxPres,                4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
     10, 1, 1,   "inlet max pres" },

#define det_max_flow                    74

   {{ (void *)(long)GetMaxDetGasFlow,               4, Ptr_Num     },
    { (void *)(long)0,                              4, Ptr_Val     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
     10, 1, 1,   "inlet max pres" },


#define ramp_max_pres_rate              75

   {{ (void *)(long)GetRampMaxPresRate,             4, Ptr_Num     },
    { (void *)(long)0,                              4, Ptr_Val     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
     10, 1, 1,   "inlet max pres" },


#define ramp_max_flow_rate              76

   {{ (void *)(long)GetRampMaxFlowRate,             4, Ptr_Num     },
    { (void *)(long)0,                              4, Ptr_Val     },
    { (void *)(long)0,                              4, Ptr         },
    { (void *)(long)0,                              4, Ptr_Val     },
     10, 1, 1,   "inlet max pres" },


#define post_time                      77

   {{ (void *)(long)GetPostTimeSetpt,               4, None        },
    { (void *)(long)SetPostTimeSetpt,               4, Val         },
    { (void *)(long)GetPostTimeSetpt,               4, None        },
    { (void *)(long)DcSetPostTimeSetpt,             4, Val         },
     100, 100, 1,   "post time" },


#define temp_setpt                     78

   {{ (void *)(long)GetTempSetpt,                   4, Ptr         },
    { (void *)(long)SetTempSetpt,                   4, Ptr_Val     },
    { (void *)(long)GetTempSetpt,                   4, Ptr         },
    { (void *)(long)SetTempSetpt,                   4, Ptr_Val     },
     1, 1, 1,   "temp" },


#define temp_on                        79

   {{ (void *)(long)GetTempOnOffSetpt,              1, Ptr         },
    { (void *)(long)SetTempOn,                      1, Ptr         },
    { (void *)(long)GetTempOnOffSetpt,              1, Ptr         },
    { (void *)(long)SetTempOn,                      1, Ptr         },
     1, 1, 1,   "temp on" },

#define temp_off                       80

   {{ (void *)(long)GetTempOnOffSetpt,              1, Ptr         },
    { (void *)(long)SetTempOff,                     1, Ptr         },
    { (void *)(long)GetTempOnOffSetpt,              1, Ptr         },
    { (void *)(long)SetTempOff,                     1, Ptr         },
     1, 1, 1,   "temp off" }


};



  /* define pneu names objects */

typedef struct {
         void   *Obj_Ptr;
         U_INT8  Obj_Num;
       } OBJECT_ID;

static const OBJECT_ID Object_Id [] =
{
#define c1         0
                        { (void *)&Inst_Status.Pneu.Column_1,      0 },
#define c1_ramp1   1
                        { (void *)&Inst_Status.Pneu.Column_1,      1 },
#define c1_ramp2   2
                        { (void *)&Inst_Status.Pneu.Column_1,      2 },
#define c1_ramp3   3
                        { (void *)&Inst_Status.Pneu.Column_1,      3 },

#define c2         4
                        { (void *)&Inst_Status.Pneu.Column_2,      0 },
#define c2_ramp1   5
                        { (void *)&Inst_Status.Pneu.Column_2,      1 },
#define c2_ramp2   6
                        { (void *)&Inst_Status.Pneu.Column_2,      2 },
#define c2_ramp3   7
                        { (void *)&Inst_Status.Pneu.Column_2,      3 },

#define fi         8
                        { (void *)&Inst_Status.Pneu.Frnt_Inlet,    0 },
#define bi         9
                        { (void *)&Inst_Status.Pneu.Back_Inlet,    0 },

#define fd         10
                        { (void *)&Inst_Status.Pneu.Frnt_Detector, 3 },
#define fd_fuel    11
                        { (void *)&Inst_Status.Pneu.Frnt_Detector, 1 },
#define fd_util    12
                        { (void *)&Inst_Status.Pneu.Frnt_Detector, 2 },
#define fd_mug     13
                        { (void *)&Inst_Status.Pneu.Frnt_Detector, 3 },

#define bd         14
                        { (void *)&Inst_Status.Pneu.Back_Detector, 3 },
#define bd_fuel    15
                        { (void *)&Inst_Status.Pneu.Back_Detector, 1 },
#define bd_util    16
                        { (void *)&Inst_Status.Pneu.Back_Detector, 2 },
#define bd_mug     17
                        { (void *)&Inst_Status.Pneu.Back_Detector, 3 },

#define a3         18
                        { (void *)&Inst_Status.Pneu.Aux.Aux_3,     0 },
#define a3_ramp1   19
                        { (void *)&Inst_Status.Pneu.Aux.Aux_3,     1 },
#define a3_ramp2   20
                        { (void *)&Inst_Status.Pneu.Aux.Aux_3,     2 },
#define a3_ramp3   21
                        { (void *)&Inst_Status.Pneu.Aux.Aux_3,     3 },

#define a4         22
                        { (void *)&Inst_Status.Pneu.Aux.Aux_4,     0 },
#define a4_ramp1   23
                        { (void *)&Inst_Status.Pneu.Aux.Aux_4,     1 },
#define a4_ramp2   24
                        { (void *)&Inst_Status.Pneu.Aux.Aux_4,     2 },
#define a4_ramp3   25
                        { (void *)&Inst_Status.Pneu.Aux.Aux_4,     3 },

#define a5         26
                        { (void *)&Inst_Status.Pneu.Aux.Aux_5,     0 },
#define a5_ramp1   27
                        { (void *)&Inst_Status.Pneu.Aux.Aux_5,     1 },
#define a5_ramp2   28
                        { (void *)&Inst_Status.Pneu.Aux.Aux_5,     2 },
#define a5_ramp3   29
                        { (void *)&Inst_Status.Pneu.Aux.Aux_5,     3 },
#define oven       30
                        { (void *)&Oven_Table,                     0 }
};



/* cmd mnemonics */

#define END            0
#define TEST           1
#define SET            2
#define SETA           3
#define SETB           4
#define SETC           5
#define SETD           6
#define GET            7
#define GETA           8
#define GETB           9
#define GETC          10
#define GETD          11
#define CMPI          12
#define CMPA          13
#define CMPB          14
#define CMPC          15
#define CMPD          16
#define IFEQ          17
#define IFNE          18
#define IFGT          19
#define IFLT          20
#define GOTO_TEST     21
#define HALT          22
#define IGNORE_ERRORS 23
#define TRAP_ERRORS   24
#define IFOK          25
#define IFNOTOK       26
#define WAIT          27
#define DATACOMM      28
#define KEY_BOARD     29
#define LOADA         30
#define LOADB         31
#define LOADC         32
#define LOADD         33
#define ADDA          34
#define ADDB          35
#define ADDC          36
#define ADDD          37
#define CMPAB         38
#define LOAD_METH     39
#define SAVE_METH     40
#define CHECK_METH    41
#define TEST_EXCEPT   42
#define EXEC_SLOW     43
#define EXEC_FAST     44
#define CMP_NEG_I     45
#define HALT_IF_NE    46
#define HALT_IF_EQ    47
#define CMP           48
#define HALT_IF_OK    49
#define HALT_IF_NOK   50
#define CHECK_BOUNDS  51
#define START         52
#define STOP          53
#define PREPARE       54




static const DEF Cmd_Tags [] = {

            { (BIT8 *)"end",           (U_INT16)END,           0  },   /* enum type flags syntax: cmd value */
            { (BIT8 *)"test",          (U_INT16)TEST,          1  },
            { (BIT8 *)"slow",          (U_INT16)EXEC_SLOW,     0  },
            { (BIT8 *)"fast",          (U_INT16)EXEC_FAST,     0  },
            { (BIT8 *)"goto_test",     (U_INT16)GOTO_TEST,     1  },
            { (BIT8 *)"halt",          (U_INT16)HALT,          0  },
            { (BIT8 *)"ignore_errors", (U_INT16)IGNORE_ERRORS, 0  },
            { (BIT8 *)"trap_errors",   (U_INT16)TRAP_ERRORS,   0  },
            { (BIT8 *)"wait",          (U_INT16)WAIT,          0  },
            { (BIT8 *)"use_dc_funcs",  (U_INT16)DATACOMM,      0  },
            { (BIT8 *)"use_kbd_funcs", (U_INT16)KEY_BOARD,     0  },

            { (BIT8 *)"set",           (U_INT16)SET,           0  },
            { (BIT8 *)"seta",          (U_INT16)SETA,          0  },
            { (BIT8 *)"setb",          (U_INT16)SETB,          0  },
            { (BIT8 *)"setc",          (U_INT16)SETC,          0  },
            { (BIT8 *)"setd",          (U_INT16)SETD,          0  },

            { (BIT8 *)"get",           (U_INT16)GET,           0  },
            { (BIT8 *)"geta",          (U_INT16)GETA,          0  },
            { (BIT8 *)"getb",          (U_INT16)GETB,          0  },
            { (BIT8 *)"getc",          (U_INT16)GETC,          0  },
            { (BIT8 *)"getd",          (U_INT16)GETD,          0  },

            { (BIT8 *)"loada",         (U_INT16)LOADA,         1  },
            { (BIT8 *)"loadb",         (U_INT16)LOADB,         1  },
            { (BIT8 *)"loadc",         (U_INT16)LOADC,         1  },
            { (BIT8 *)"loadd",         (U_INT16)LOADD,         1  },

            { (BIT8 *)"adda",          (U_INT16)ADDA,          1  },
            { (BIT8 *)"addb",          (U_INT16)ADDB,          1  },
            { (BIT8 *)"addc",          (U_INT16)ADDC,          1  },
            { (BIT8 *)"addd",          (U_INT16)ADDD,          1  },

            { (BIT8 *)"cmp",           (U_INT16)CMP,           0  },
            { (BIT8 *)"cmpa",          (U_INT16)CMPA,          0  },
            { (BIT8 *)"cmpb",          (U_INT16)CMPB,          0  },
            { (BIT8 *)"cmpc",          (U_INT16)CMPC,          0  },
            { (BIT8 *)"cmpd",          (U_INT16)CMPD,          0  },
            { (BIT8 *)"cmpAB",         (U_INT16)CMPAB,         1  },

            { (BIT8 *)"must_be_ne",    (U_INT16)CMP_NEG_I,     0  },
            { (BIT8 *)"must_be_eq",    (U_INT16)CMPI,          0  },

            { (BIT8 *)"ifeq",          (U_INT16)IFEQ,          0  },
            { (BIT8 *)"ifne",          (U_INT16)IFNE,          0  },
            { (BIT8 *)"ifgt",          (U_INT16)IFGT,          0  },
            { (BIT8 *)"iflt",          (U_INT16)IFLT,          0  },
            { (BIT8 *)"ifok",          (U_INT16)IFOK,          0  },
            { (BIT8 *)"ifnok",         (U_INT16)IFNOTOK,       0  },

            { (BIT8 *)"load_meth",     (U_INT16)LOAD_METH,     1  },
            { (BIT8 *)"save_meth",     (U_INT16)SAVE_METH,     1  },
            { (BIT8 *)"check_meth",    (U_INT16)CHECK_METH,    1  },
            { (BIT8 *)"test_exception",(U_INT16)TEST_EXCEPT,   2  },

            { (BIT8 *)"halt_if_eq",    (U_INT16)HALT_IF_EQ,    0  },
            { (BIT8 *)"halt_if_ne",    (U_INT16)HALT_IF_NE,    0  },
            { (BIT8 *)"halt_if_ok",    (U_INT16)HALT_IF_OK,    0  },
            { (BIT8 *)"halt_if_nok",   (U_INT16)HALT_IF_NOK,   0  },

            { (BIT8 *)"check_bounds",  (U_INT16)CHECK_BOUNDS,  0  },

            { (BIT8 *)"start",         (U_INT16)START,         0  },
            { (BIT8 *)"stop",          (U_INT16)STOP,          2  },
            { (BIT8 *)"prepare",       (U_INT16)PREPARE,       2  },

            { (BIT8 *)"",              (U_INT16)-1,            0  }
};

static const DEF Obj_Tags [] = {

            { (BIT8 *)"c1",         (U_INT16)c1,         0  },
            { (BIT8 *)"c1_ramp1",   (U_INT16)c1_ramp1,   0  },
            { (BIT8 *)"c1_ramp2",   (U_INT16)c1_ramp2,   0  },
            { (BIT8 *)"c1_ramp3",   (U_INT16)c1_ramp3,   0  },
            { (BIT8 *)"c2",         (U_INT16)c2,         0  },
            { (BIT8 *)"c2_ramp1",   (U_INT16)c2_ramp1,   0  },
            { (BIT8 *)"c2_ramp2",   (U_INT16)c2_ramp2,   0  },
            { (BIT8 *)"c2_ramp3",   (U_INT16)c2_ramp3,   0  },
            { (BIT8 *)"fi",         (U_INT16)fi,         0  },
            { (BIT8 *)"bi",         (U_INT16)bi,         0  },
            { (BIT8 *)"fd",         (U_INT16)fd,         0  },
            { (BIT8 *)"fd_fuel",    (U_INT16)fd_fuel,    0  },
            { (BIT8 *)"fd_util",    (U_INT16)fd_util,    0  },
            { (BIT8 *)"fd_mug",     (U_INT16)fd_mug,     0  },
            { (BIT8 *)"bd",         (U_INT16)bd,         0  },
            { (BIT8 *)"bd_fuel",    (U_INT16)bd_fuel,    0  },
            { (BIT8 *)"bd_util",    (U_INT16)bd_util,    0  },
            { (BIT8 *)"bd_mug",     (U_INT16)bd_mug,     0  },
            { (BIT8 *)"a3",         (U_INT16)a3,         0  },
            { (BIT8 *)"a3_ramp1",   (U_INT16)a3_ramp1,   0  },
            { (BIT8 *)"a3_ramp2",   (U_INT16)a3_ramp2,   0  },
            { (BIT8 *)"a3_ramp3",   (U_INT16)a3_ramp3,   0  },
            { (BIT8 *)"a4",         (U_INT16)a4,         0  },
            { (BIT8 *)"a4_ramp1",   (U_INT16)a4_ramp1,   0  },
            { (BIT8 *)"a4_ramp2",   (U_INT16)a4_ramp2,   0  },
            { (BIT8 *)"a4_ramp3",   (U_INT16)a4_ramp3,   0  },
            { (BIT8 *)"a5",         (U_INT16)a5,         0  },
            { (BIT8 *)"a5_ramp1",   (U_INT16)a5_ramp1,   0  },
            { (BIT8 *)"a5_ramp2",   (U_INT16)a5_ramp2,   0  },
            { (BIT8 *)"a5_ramp3",   (U_INT16)a5_ramp3,   0  },
            { (BIT8 *)"oven",       (U_INT16)oven,       0  },
            { (BIT8 *)"",           (U_INT16)-1,         0  }

};

static const DEF Setpt_Tags [] = {


       {  (BIT8 *)"aux_pres_actual",        (U_INT16)aux_pres_actual,       0  },
       {  (BIT8 *)"aux_pres",               (U_INT16)aux_pres,              0  },
       {  (BIT8 *)"aux_state",              (U_INT16)aux_state,             0  },
       {  (BIT8 *)"aux_max_pres",           (U_INT16)aux_max_pres,          0  },
       {  (BIT8 *)"aux_gas_type",           (U_INT16)aux_gas_type,          0  },
       {  (BIT8 *)"aux_init_pres",          (U_INT16)aux_init_pres,         0  },
       {  (BIT8 *)"aux_pres_rate",          (U_INT16)aux_pres_rate,         0  },
       {  (BIT8 *)"aux_final_pres",         (U_INT16)aux_final_pres,        0  },
       {  (BIT8 *)"aux_init_time",          (U_INT16)aux_init_time,         0  },
       {  (BIT8 *)"aux_final_time",         (U_INT16)aux_final_time,        0  },
       {  (BIT8 *)"aux_equib_time",         (U_INT16)aux_equib_time,        0  },
       {  (BIT8 *)"col_ramp_type",          (U_INT16)col_ramp_type,         0  },
       {  (BIT8 *)"col_diam",               (U_INT16)col_diam,              0  },
       {  (BIT8 *)"col_length",             (U_INT16)col_length,            0  },
       {  (BIT8 *)"col_film_thickness",     (U_INT16)col_film_thickness,    0  },
       {  (BIT8 *)"col_source",             (U_INT16)col_source,            0  },
       {  (BIT8 *)"col_vacuum_comp",        (U_INT16)col_vacuum_comp,       0  },
       {  (BIT8 *)"col_pres_comp",          (U_INT16)col_pres_comp,         0  },
       {  (BIT8 *)"col_pres_comp_setpt",    (U_INT16)col_pres_comp_setpt,   0  },
       {  (BIT8 *)"col_max_pres_comp_setpt",(U_INT16)col_max_pres_comp_setpt, 0  },
       {  (BIT8 *)"col_head_pres",          (U_INT16)col_head_pres,         0  },
       {  (BIT8 *)"col_vflow",              (U_INT16)col_vflow,             0  },
       {  (BIT8 *)"col_avg_velocity",       (U_INT16)col_avg_velocity,      0  },
       {  (BIT8 *)"col_vflow_actual",       (U_INT16)col_vflow_actual,      0  },
       {  (BIT8 *)"col_control_mode",       (U_INT16)col_control_mode,      0  },
       {  (BIT8 *)"col_post_pres",          (U_INT16)col_post_pres,         0  },
       {  (BIT8 *)"col_post_flow",          (U_INT16)col_post_flow,         0  },
       {  (BIT8 *)"col_source_state",       (U_INT16)col_source_state,      0  },
       {  (BIT8 *)"col_source_max_pres",    (U_INT16)col_source_max_pres,   0  },
       {  (BIT8 *)"col_source_max_flow",    (U_INT16)col_source_max_flow,   0  },
       {  (BIT8 *)"col_calib_mode",         (U_INT16)col_calib_mode,        0  },
       {  (BIT8 *)"col_hold_time",          (U_INT16)col_hold_time,         0  },
       {  (BIT8 *)"col_meas_flow",          (U_INT16)col_meas_flow,         0  },
       {  (BIT8 *)"col_calib_length",       (U_INT16)col_calib_length,      0  },
       {  (BIT8 *)"col_calib_diam",         (U_INT16)col_calib_diam,        0  },
       {  (BIT8 *)"col_init_pres",          (U_INT16)col_init_pres,         0  },
       {  (BIT8 *)"col_init_time",          (U_INT16)col_init_time,         0  },
       {  (BIT8 *)"col_pres_rate",          (U_INT16)col_pres_rate,         0  },
       {  (BIT8 *)"col_final_pres",         (U_INT16)col_final_pres,        0  },
       {  (BIT8 *)"col_final_time",         (U_INT16)col_final_time,        0  },
       {  (BIT8 *)"col_init_flow",          (U_INT16)col_init_flow,         0  },
       {  (BIT8 *)"col_flow_rate",          (U_INT16)col_flow_rate,         0  },
       {  (BIT8 *)"col_final_flow",         (U_INT16)col_final_flow,        0  },
       {  (BIT8 *)"inlet_gas_type",         (U_INT16)inlet_gas_type,        0  },
       {  (BIT8 *)"inlet_miser_mode",       (U_INT16)inlet_miser_mode,      0  },
       {  (BIT8 *)"det_flow",               (U_INT16)det_flow,              0  },
       {  (BIT8 *)"det_state",              (U_INT16)det_state,             0  },
       {  (BIT8 *)"det_const_mug_mode",     (U_INT16)det_const_mug_mode,    0  },
       {  (BIT8 *)"det_combo_flow",         (U_INT16)det_combo_flow,        0  },
       {  (BIT8 *)"det_gas_type",           (U_INT16)det_gas_type,          0  },
       {  (BIT8 *)"det_type",               (U_INT16)det_type,              0  },
       {  (BIT8 *)"inlet_pres",             (U_INT16)inlet_pres,            0  },
       {  (BIT8 *)"inlet_pres_immediate",   (U_INT16)inlet_pres_immediate,  0  },
       {  (BIT8 *)"inlet_flow",             (U_INT16)inlet_flow,            0  },
       {  (BIT8 *)"inlet_flow_immediate",   (U_INT16)inlet_flow_immediate,  0  },
       {  (BIT8 *)"inlet_inject_mode",      (U_INT16)inlet_inject_mode,     0  },
       {  (BIT8 *)"inlet_split_flow",       (U_INT16)inlet_split_flow,      0  },
       {  (BIT8 *)"inlet_min_split_flow",   (U_INT16)inlet_min_split_flow,  0  },
       {  (BIT8 *)"inlet_max_split_flow",   (U_INT16)inlet_max_split_flow,  0  },
       {  (BIT8 *)"inlet_max_total_flow",   (U_INT16)inlet_max_total_flow,  0  },
       {  (BIT8 *)"inlet_miser_flow",       (U_INT16)inlet_miser_flow,      0  },
       {  (BIT8 *)"inlet_min_miser_flow",   (U_INT16)inlet_min_miser_flow,  0  },
       {  (BIT8 *)"inlet_purge_flow",       (U_INT16)inlet_purge_flow,      0  },
       {  (BIT8 *)"inlet_miser_time",       (U_INT16)inlet_miser_time,      0  },
       {  (BIT8 *)"inlet_purge_time",       (U_INT16)inlet_purge_time,      0  },
       {  (BIT8 *)"inlet_pulse_time",       (U_INT16)inlet_pulse_time,      0  },
       {  (BIT8 *)"inlet_pulse_pres",       (U_INT16)inlet_pulse_pres,      0  },
       {  (BIT8 *)"inlet_split_ratio",      (U_INT16)inlet_split_ratio,     0  },
       {  (BIT8 *)"inlet_min_split_ratio",  (U_INT16)inlet_min_split_ratio, 0  },
       {  (BIT8 *)"inlet_max_split_ratio",  (U_INT16)inlet_max_split_ratio, 0  },
       {  (BIT8 *)"inlet_state",            (U_INT16)inlet_state,           0  },
       {  (BIT8 *)"inlet_type",             (U_INT16)inlet_type,            0  },
       {  (BIT8 *)"inlet_max_pres",         (U_INT16)inlet_max_pres,        0  },
       {  (BIT8 *)"inlet_max_flow",         (U_INT16)inlet_max_flow,        0  },
       {  (BIT8 *)"inlet_max_pres",         (U_INT16)inlet_max_pres,        0  },
       {  (BIT8 *)"det_max_flow",           (U_INT16)det_max_flow,          0  },
       {  (BIT8 *)"ramp_max_pres_rate",     (U_INT16)ramp_max_pres_rate,    0  },
       {  (BIT8 *)"ramp_max_flow_rate",     (U_INT16)ramp_max_flow_rate,    0  },
       {  (BIT8 *)"post_time",              (U_INT16)post_time,             0  },
       {  (BIT8 *)"temp_setpt",             (U_INT16)temp_setpt,            0  },
       {  (BIT8 *)"temp_on",                (U_INT16)temp_on,               0  },
       {  (BIT8 *)"temp_off",               (U_INT16)temp_off,              0  },
       { (BIT8 *)"",                        (U_INT16)(U_INT16)-1,           0  }

};

#define REGISTER_CLASS 16
#define RegA           1
#define RegB           2
#define RegC           3
#define RegD           4

static const DEF Enum_Tags [] = {

    {  (BIT8 *)"ON",                  (U_INT16)ON,                1   },
    {  (BIT8 *)"OFF",                 (U_INT16)OFF,               1   },
    {  (BIT8 *)"SHUTDOWN",            (U_INT16)SHUTDOWN,          1   },
    {  (BIT8 *)"FAIL",                (U_INT16)FAIL,              1   },
    {  (BIT8 *)"TRANSITION",          (U_INT16)TRANSITION,        1   },
    {  (BIT8 *)"WAITING",             (U_INT16)WAITING,           1   },
    {  (BIT8 *)"WAITING2",            (U_INT16)WAITING2,          1   },

    {  (BIT8 *)"PP",                  (U_INT16)PP,                2   },
    {  (BIT8 *)"COC",                 (U_INT16)COC,               2   },
    {  (BIT8 *)"SS",                  (U_INT16)SS,                2   },
    {  (BIT8 *)"PTV",                 (U_INT16)PTV,               2   },
    {  (BIT8 *)"MANUAL_PP",           (U_INT16)MANUAL_PP,         2   },
    {  (BIT8 *)"MANUAL_COC",          (U_INT16)MANUAL_COC,        2   },
    {  (BIT8 *)"MANUAL_SS",           (U_INT16)MANUAL_SS,         2   },
    {  (BIT8 *)"UNKNOWN_INLET",       (U_INT16)UNKNOWN_INLET,     2   },
    {  (BIT8 *)"NO_INLET",            (U_INT16)NO_INLET,          2   },
    {  (BIT8 *)"ACI",                 (U_INT16)ACI,               2   },
    {  (BIT8 *)"G_PTV",               (U_INT16)G_PTV,             2   },
    {  (BIT8 *)"JIB",                 (U_INT16)JIB,               2   },
    {  (BIT8 *)"MANUAL_ACI",          (U_INT16)MANUAL_ACI,        2   },

    {  (BIT8 *)"INLET_MODULE",        (U_INT16)INLET_MODULE,      3   },
    {  (BIT8 *)"DET_MODULE",          (U_INT16)DET_MODULE,        3   },
    {  (BIT8 *)"AUX_MODULE",          (U_INT16)AUX_MODULE,        3   },

    {  (BIT8 *)"PP_INLET",            (U_INT16)PP_INLET,          4   },
    {  (BIT8 *)"COC_INLET",           (U_INT16)COC_INLET,         4   },
    {  (BIT8 *)"SS_INLET",            (U_INT16)SS_INLET,          4   },
    {  (BIT8 *)"PTV_INLET",           (U_INT16)PTV_INLET,         4   },
    {  (BIT8 *)"MAN_PP_INLET",        (U_INT16)MAN_PP_INLET,      4   },
    {  (BIT8 *)"MAN_COC_INLET",       (U_INT16)MAN_COC_INLET,     4   },
    {  (BIT8 *)"MAN_SS_INLET",        (U_INT16)MAN_SS_INLET,      4   },
    {  (BIT8 *)"SOME_AUX",            (U_INT16)SOME_AUX,          4   },
    {  (BIT8 *)"UNKNOWN_TYPE",        (U_INT16)UNKNOWN_TYPE,      4   },
    {  (BIT8 *)"ACI_INLET",           (U_INT16)ACI_INLET,         4   },
    {  (BIT8 *)"G_PTV_INLET",         (U_INT16)G_PTV_INLET,       4   },
    {  (BIT8 *)"MAN_ACI_INLET",       (U_INT16)MAN_ACI_INLET,     4   },

    {  (BIT8 *)"FID",                 (U_INT16)FID,               5   },
    {  (BIT8 *)"TCD",                 (U_INT16)TCD,               5   },
    {  (BIT8 *)"ECD",                 (U_INT16)ECD,               5   },
    {  (BIT8 *)"NPD",                 (U_INT16)NPD,               5   },
    {  (BIT8 *)"FPD",                 (U_INT16)FPD,               5   },
    {  (BIT8 *)"AIB",                 (U_INT16)AIB,               5   },
    {  (BIT8 *)"uECD",                (U_INT16)uECD,              5   },
    {  (BIT8 *)"uECD2",               (U_INT16)uECD2,             5   },
    {  (BIT8 *)"NO_DET",              (U_INT16)NO_DET,            5   },

    {  (BIT8 *)"MAN_FID",             (U_INT16)MAN_FID,           6   },
    {  (BIT8 *)"MAN_TCD",             (U_INT16)MAN_TCD,           6   },
    {  (BIT8 *)"MAN_ECD",             (U_INT16)MAN_ECD,           6   },
    {  (BIT8 *)"MAN_NPD",             (U_INT16)MAN_NPD,           6   },
    {  (BIT8 *)"MAN_FPD",             (U_INT16)MAN_FPD,           6   },
    {  (BIT8 *)"EPC_FID",             (U_INT16)EPC_FID,           6   },
    {  (BIT8 *)"EPC_TCD",             (U_INT16)EPC_TCD,           6   },
    {  (BIT8 *)"EPC_ECD",             (U_INT16)EPC_ECD,           6   },
    {  (BIT8 *)"EPC_NPD",             (U_INT16)EPC_NPD,           6   },
    {  (BIT8 *)"EPC_FPD",             (U_INT16)EPC_FPD,           6   },
    {  (BIT8 *)"EP_uECD",             (U_INT16)EPC_uECD,          6   },
    {  (BIT8 *)"EPuECD2",             (U_INT16)EPC_uECD2,         6   },

    {  (BIT8 *)"N2",                  (U_INT16)N2,                7   },
    {  (BIT8 *)"H2",                  (U_INT16)H2,                7   },
    {  (BIT8 *)"He",                  (U_INT16)He,                7   },
    {  (BIT8 *)"ArMe",                (U_INT16)ArMe,              7   },
    {  (BIT8 *)"O2",                  (U_INT16)O2,                7   },
    {  (BIT8 *)"Air",                 (U_INT16)Air,               7   },
    {  (BIT8 *)"Argon",               (U_INT16)Argon,             7   },
    {  (BIT8 *)"UNKNOWN_GAS",         (U_INT16)UNKNOWN_GAS,       7   },

    {  (BIT8 *)"CONST_PRES",          (U_INT16)CONST_PRES,        8   },
    {  (BIT8 *)"CONST_FLOW",          (U_INT16)CONST_FLOW,        8   },
    {  (BIT8 *)"RAMP_PRES",           (U_INT16)RAMP_PRES,         8   },
    {  (BIT8 *)"RAMP_FLOW",           (U_INT16)RAMP_FLOW,         8   },

    {  (BIT8 *)"FRNT_INLET",          (U_INT16)FRNT_INLET,        9   },
    {  (BIT8 *)"BACK_INLET",          (U_INT16)BACK_INLET,        9   },
    {  (BIT8 *)"AUX_3",               (U_INT16)AUX_3,             9   },
    {  (BIT8 *)"AUX_4",               (U_INT16)AUX_4,             9   },
    {  (BIT8 *)"AUX_5",               (U_INT16)AUX_5,             9   },
    {  (BIT8 *)"UNKNOWN_SOURCE",      (U_INT16)UNKNOWN_SOURCE,    9   },

    {  (BIT8 *)"FRNT_DET",            (U_INT16)FRNT_DET,         10   },
    {  (BIT8 *)"BACK_DET",            (U_INT16)BACK_DET,         10   },
    {  (BIT8 *)"MSD",                 (U_INT16)MSD,              10   },
    {  (BIT8 *)"AED",                 (U_INT16)AED,              10   },
    {  (BIT8 *)"UNKNOWN_OUTLET",      (U_INT16)UNKNOWN_OUTLET,   10   },

    {  (BIT8 *)"DISPLAY_PSI",         (U_INT16)DISPLAY_PSI,      11   },
    {  (BIT8 *)"DISPLAY_BAR",         (U_INT16)DISPLAY_BAR,      11   },
    {  (BIT8 *)"DISPLAY_KPA",         (U_INT16)DISPLAY_KPA,      11   },

    {  (BIT8 *)"SPLIT",               (U_INT16)SPLIT,            12   },
    {  (BIT8 *)"SPLITLESS",           (U_INT16)SPLITLESS,        12   },
    {  (BIT8 *)"SPLITLESS_PULSED",    (U_INT16)SPLITLESS_PULSED, 12   },
    {  (BIT8 *)"SPLIT_PULSED",        (U_INT16)SPLIT_PULSED,     12   },

    {  (BIT8 *)"INVALID_RAMP",        (U_INT16)INVALID_RAMP,     13   },
    {  (BIT8 *)"THERMAL_RAMP",        (U_INT16)THERMAL_RAMP,     13   },
    {  (BIT8 *)"PRESSURE_RAMP",       (U_INT16)PRESSURE_RAMP,    13   },
    {  (BIT8 *)"FLOW_RAMP",           (U_INT16)FLOW_RAMP,        13   },


    {  (BIT8 *)"TRUE",                (U_INT16)TRUE,             14   },
    {  (BIT8 *)"FALSE",               (U_INT16)FALSE,            14   },

    {  (BIT8 *)"FRNT_INLET_PRESSURE",       (U_INT16)FRNT_INLET_PRESSURE,          15   },
    {  (BIT8 *)"FRNT_INLET_FLOW",           (U_INT16)FRNT_INLET_FLOW,              15   },
    {  (BIT8 *)"BACK_INLET_PRESSURE",       (U_INT16)BACK_INLET_PRESSURE,          15   },
    {  (BIT8 *)"BACK_INLET_FLOW",           (U_INT16)BACK_INLET_FLOW,              15   },
    {  (BIT8 *)"FRNT_DET_GAS_1_FLOW",       (U_INT16)FRNT_DET_GAS_1_FLOW,          15   },
    {  (BIT8 *)"FRNT_DET_GAS_2_FLOW",       (U_INT16)FRNT_DET_GAS_2_FLOW,          15   },
    {  (BIT8 *)"FRNT_DET_GAS_3_FLOW",       (U_INT16)FRNT_DET_GAS_3_FLOW,          15   },
    {  (BIT8 *)"BACK_DET_GAS_1_FLOW",       (U_INT16)BACK_DET_GAS_1_FLOW,          15   },
    {  (BIT8 *)"BACK_DET_GAS_2_FLOW",       (U_INT16)BACK_DET_GAS_2_FLOW,          15   },
    {  (BIT8 *)"BACK_DET_GAS_3_FLOW",       (U_INT16)BACK_DET_GAS_3_FLOW,          15   },
    {  (BIT8 *)"FRNT_DET_GAS_1_OFF",        (U_INT16)FRNT_DET_GAS_1_OFF,           15   },
    {  (BIT8 *)"FRNT_DET_GAS_2_OFF",        (U_INT16)FRNT_DET_GAS_2_OFF,           15   },
    {  (BIT8 *)"FRNT_DET_GAS_3_OFF",        (U_INT16)FRNT_DET_GAS_3_OFF,           15   },
    {  (BIT8 *)"BACK_DET_GAS_1_OFF",        (U_INT16)BACK_DET_GAS_1_OFF,           15   },
    {  (BIT8 *)"BACK_DET_GAS_2_OFF",        (U_INT16)BACK_DET_GAS_2_OFF,           15   },
    {  (BIT8 *)"BACK_DET_GAS_3_OFF",        (U_INT16)BACK_DET_GAS_3_OFF,           15   },
    {  (BIT8 *)"AUX_3_PRES",                (U_INT16)AUX_3_PRES,                   15   },
    {  (BIT8 *)"AUX_4_PRES",                (U_INT16)AUX_4_PRES,                   15   },
    {  (BIT8 *)"AUX_5_PRES",                (U_INT16)AUX_5_PRES,                   15   },
    {  (BIT8 *)"HYDROGEN_SHUTDOWN",         (U_INT16)HYDROGEN_SHUTDOWN,            15   },
    {  (BIT8 *)"FRNT_INLET_PRES_SHUTDOWN",  (U_INT16)FRNT_INLET_PRES_SHUTDOWN,     15   },
    {  (BIT8 *)"FRNT_INLET_FLOW_SHUTDOWN",  (U_INT16)FRNT_INLET_FLOW_SHUTDOWN,     15   },
    {  (BIT8 *)"BACK_INLET_PRES_SHUTDOWN",  (U_INT16)BACK_INLET_PRES_SHUTDOWN,     15   },
    {  (BIT8 *)"BACK_INLET_FLOW_SHUTDOWN",  (U_INT16)BACK_INLET_FLOW_SHUTDOWN,     15   },
    {  (BIT8 *)"FRNT_DET_GAS_1_SHUTDOWN",   (U_INT16)FRNT_DET_GAS_1_SHUTDOWN,      15   },
    {  (BIT8 *)"FRNT_DET_GAS_2_SHUTDOWN",   (U_INT16)FRNT_DET_GAS_2_SHUTDOWN,      15   },
    {  (BIT8 *)"FRNT_DET_GAS_3_SHUTDOWN",   (U_INT16)FRNT_DET_GAS_3_SHUTDOWN,      15   },
    {  (BIT8 *)"BACK_DET_GAS_1_SHUTDOWN",   (U_INT16)BACK_DET_GAS_1_SHUTDOWN,      15   },
    {  (BIT8 *)"BACK_DET_GAS_2_SHUTDOWN",   (U_INT16)BACK_DET_GAS_2_SHUTDOWN,      15   },
    {  (BIT8 *)"BACK_DET_GAS_3_SHUTDOWN",   (U_INT16)BACK_DET_GAS_3_SHUTDOWN,      15   },
    {  (BIT8 *)"PNEU_AUX_3_SHUTDOWN",       (U_INT16)PNEU_AUX_3_SHUTDOWN,          15   },
    {  (BIT8 *)"PNEU_AUX_4_SHUTDOWN",       (U_INT16)PNEU_AUX_4_SHUTDOWN,          15   },
    {  (BIT8 *)"PNEU_AUX_5_SHUTDOWN",       (U_INT16)PNEU_AUX_5_SHUTDOWN,          15   },
    {  (BIT8 *)"DIRTBALL",                  (U_INT16)DIRTBALL,                     15   },
    {  (BIT8 *)"FRNT_INLET_TYPE",           (U_INT16)FRNT_INLET_TYPE,              15   },
    {  (BIT8 *)"FRNT_INLET_RANGE",          (U_INT16)FRNT_INLET_RANGE,             15   },
    {  (BIT8 *)"FRNT_INLET_EPC",            (U_INT16)FRNT_INLET_EPC,               15   },
    {  (BIT8 *)"FRNT_INLET_GAS_TYPE",       (U_INT16)FRNT_INLET_GAS_TYPE,          15   },
    {  (BIT8 *)"FRNT_INLET_PRES_EQUIB",     (U_INT16)FRNT_INLET_PRES_EQUIB,        15   },
    {  (BIT8 *)"FRNT_INLET_FLOW_EQUIB",     (U_INT16)FRNT_INLET_FLOW_EQUIB,        15   },
    {  (BIT8 *)"BACK_INLET_TYPE",           (U_INT16)BACK_INLET_TYPE,              15   },
    {  (BIT8 *)"BACK_INLET_RANGE",          (U_INT16)BACK_INLET_RANGE,             15   },
    {  (BIT8 *)"BACK_INLET_EPC",            (U_INT16)BACK_INLET_EPC,               15   },
    {  (BIT8 *)"BACK_INLET_GAS_TYPE",       (U_INT16)BACK_INLET_GAS_TYPE,          15   },
    {  (BIT8 *)"BACK_INLET_PRES_EQUIB",     (U_INT16)BACK_INLET_PRES_EQUIB,        15   },
    {  (BIT8 *)"BACK_INLET_FLOW_EQUIB",     (U_INT16)BACK_INLET_FLOW_EQUIB,        15   },
    {  (BIT8 *)"FRNT_DET_TYPE_MISMATCH",    (U_INT16)FRNT_DET_TYPE_MISMATCH,       15   },
    {  (BIT8 *)"FRNT_DET_EPC",              (U_INT16)FRNT_DET_EPC,                 15   },
    {  (BIT8 *)"FRNT_DET_FUEL_RANGE",       (U_INT16)FRNT_DET_FUEL_RANGE,          15   },
    {  (BIT8 *)"FRNT_DET_UTIL_RANGE",       (U_INT16)FRNT_DET_UTIL_RANGE,          15   },
    {  (BIT8 *)"FRNT_DET_MUG_RANGE",        (U_INT16)FRNT_DET_MUG_RANGE,           15   },
    {  (BIT8 *)"FRNT_DET_UTIL_GAS_TYPE",    (U_INT16)FRNT_DET_UTIL_GAS_TYPE,       15   },
    {  (BIT8 *)"FRNT_DET_MUG_GAS_TYPE",     (U_INT16)FRNT_DET_MUG_GAS_TYPE,        15   },
    {  (BIT8 *)"BACK_DET_TYPE_MISMATCH",    (U_INT16)BACK_DET_TYPE_MISMATCH,       15   },
    {  (BIT8 *)"BACK_DET_EPC",              (U_INT16)BACK_DET_EPC,                 15   },
    {  (BIT8 *)"BACK_DET_FUEL_RANGE",       (U_INT16)BACK_DET_FUEL_RANGE,          15   },
    {  (BIT8 *)"BACK_DET_UTIL_RANGE",       (U_INT16)BACK_DET_UTIL_RANGE,          15   },
    {  (BIT8 *)"BACK_DET_MUG_RANGE",        (U_INT16)BACK_DET_MUG_RANGE,           15   },
    {  (BIT8 *)"BACK_DET_UTIL_GAS_TYPE",    (U_INT16)BACK_DET_UTIL_GAS_TYPE,       15   },
    {  (BIT8 *)"BACK_DET_MUG_GAS_TYPE",     (U_INT16)BACK_DET_MUG_GAS_TYPE,        15   },
    {  (BIT8 *)"AUX_3_TYPE",                (U_INT16)AUX_3_TYPE,                   15   },
    {  (BIT8 *)"AUX_3_RANGE",               (U_INT16)AUX_3_RANGE,                  15   },
    {  (BIT8 *)"AUX_3_GAS_TYPE",            (U_INT16)AUX_3_GAS_TYPE,               15   },
    {  (BIT8 *)"AUX_3_PRES_EQUIB",          (U_INT16)AUX_3_PRES_EQUIB,             15   },
    {  (BIT8 *)"AUX_4_TYPE",                (U_INT16)AUX_4_TYPE,                   15   },
    {  (BIT8 *)"AUX_4_RANGE",               (U_INT16)AUX_4_RANGE,                  15   },
    {  (BIT8 *)"AUX_4_GAS_TYPE",            (U_INT16)AUX_4_GAS_TYPE,               15   },
    {  (BIT8 *)"AUX_4_PRES_EQUIB",          (U_INT16)AUX_4_PRES_EQUIB,             15   },
    {  (BIT8 *)"AUX_5_TYPE",                (U_INT16)AUX_5_TYPE,                   15   },
    {  (BIT8 *)"AUX_5_RANGE",               (U_INT16)AUX_5_RANGE,                  15   },
    {  (BIT8 *)"AUX_5_GAS_TYPE",            (U_INT16)AUX_5_GAS_TYPE,               15   },
    {  (BIT8 *)"AUX_5_PRES_EQUIB",          (U_INT16)AUX_5_PRES_EQUIB,             15   },
    {  (BIT8 *)"COLUMN1_LENGTH",            (U_INT16)COLUMN1_LENGTH,               15   },
    {  (BIT8 *)"COLUMN1_DIAM",              (U_INT16)COLUMN1_DIAM,                 15   },
    {  (BIT8 *)"COLUMN1_FILM_THICK",        (U_INT16)COLUMN1_FILM_THICK,           15   },
    {  (BIT8 *)"COLUMN1_SOURCE",            (U_INT16)COLUMN1_SOURCE,               15   },
    {  (BIT8 *)"COLUMN1_OUTLET",            (U_INT16)COLUMN1_OUTLET,               15   },
    {  (BIT8 *)"COLUMN1_VACUUM_COMP",       (U_INT16)COLUMN1_VACUUM_COMP,          15   },
    {  (BIT8 *)"COLUMN1_OUTLET_PRES_COMP",  (U_INT16)COLUMN1_OUTLET_PRES_COMP,     15   },
    {  (BIT8 *)"COLUMN1_PRES_COMP_SETPT",   (U_INT16)COLUMN1_PRES_COMP_SETPT,      15   },
    {  (BIT8 *)"COLUMN2_LENGTH",            (U_INT16)COLUMN2_LENGTH,               15   },
    {  (BIT8 *)"COLUMN2_DIAM",              (U_INT16)COLUMN2_DIAM,                 15   },
    {  (BIT8 *)"COLUMN2_FILM_THICK",        (U_INT16)COLUMN2_FILM_THICK,           15   },
    {  (BIT8 *)"COLUMN2_SOURCE",            (U_INT16)COLUMN2_SOURCE,               15   },
    {  (BIT8 *)"COLUMN2_OUTLET",            (U_INT16)COLUMN2_OUTLET,               15   },
    {  (BIT8 *)"COLUMN2_VACUUM_COMP",       (U_INT16)COLUMN2_VACUUM_COMP,          15   },
    {  (BIT8 *)"COLUMN2_OUTLET_PRES_COMP",  (U_INT16)COLUMN2_OUTLET_PRES_COMP,     15   },
    {  (BIT8 *)"COLUMN2_PRES_COMP_SETPT",   (U_INT16)COLUMN2_PRES_COMP_SETPT,      15   },

    {  (BIT8 *)"RegA",                      (U_INT16)RegA,             REGISTER_CLASS   },
    {  (BIT8 *)"RegB",                      (U_INT16)RegB,             REGISTER_CLASS   },
    {  (BIT8 *)"RegC",                      (U_INT16)RegC,             REGISTER_CLASS   },
    {  (BIT8 *)"RegD",                      (U_INT16)RegD,             REGISTER_CLASS   },

    {  (BIT8 *)"EndOvenRamp",               (U_INT16)EndOvenRamp,                  17   },
    {  (BIT8 *)"EndPostTime",               (U_INT16)EndPostTime,                  17   },
    {  (BIT8 *)"Abort",                     (U_INT16)Abort,                        17   },

    {  (BIT8 *)"Manual",                    (U_INT16)Manual,                       18   },
    {  (BIT8 *)"Auto",                      (U_INT16)Auto,                         18   },

    {  (BIT8 *)"",                    (U_INT16)-1,                0   }

};



U_INT16 ResolveTagName ( BIT8 *pname, pDEF tag_table, U_INT16 *enum_type )
{
   BIT8 *name;
   BIT8 *tag_name;

     while ( *(tag_table->tag_name) != 0 )  /* null string */
     {
        name     = pname;
        tag_name = tag_table->tag_name;

        while ( (*name != 0 ) && (*name != ' ') && ( *name != '\t' ) && ( *tag_name != 0 ))
        {
            if ( *name == *tag_name )
            {
               ++name;
               ++tag_name;
               continue;
            }

            break; /* mismatch */
        }

        /* match and end of string */

        if ((( *name == 0 ) || ( *name == ' ' ) || ( *name == '\t' )) && ( *tag_name == 0 ))
        {
             *enum_type = tag_table->enum_type;
             return tag_table->tag_value;
        }

        tag_table++;
     }

     *enum_type = 0;

     return 0xffff;
}

BIT8 *GetTagName ( U_INT16 tag, U_INT16 enum_type, pDEF tag_table )
{
     while ( *(tag_table->tag_name) != 0 )  /* null string */
     {
        if ( enum_type == 0 )  /* dont care */
        {
            if ( tag == tag_table->tag_value )  break;
        }
        else
        {
            if (( tag == tag_table->tag_value ) && ( enum_type == tag_table->enum_type )) break;
        }

        tag_table++;
     }

     return tag_table->tag_name;
}

BIT8 *CopyTagName( BIT8 *buffer, BIT8 *tag_name )
{
     for ( ; *tag_name != 0 ; buffer++ )  *buffer = *tag_name++;

     return buffer;
}

BIT8 *FormatTag ( BIT8 *buffer, U_INT16 tag_value, U_INT16 enum_type, pDEF tag_table )
{
    return  CopyTagName( buffer, GetTagName( tag_value, enum_type, tag_table ) );
}

BIT8 *GetNamePointer ( BIT8 **entry )
{
    BIT8 *cmd_name;
    BIT8  byte;

    /* skip over leading blanks */
    for ( ; ((**entry == ' ') || (**entry == '\t')) ; (*entry)++ ) {};

    cmd_name = *entry;

    /* skip over any non delimiters  */
    for ( byte = **entry ; (byte != ' ') && (byte != 0) && (byte != '\t'); byte = *(++(*entry)) ) {};

    return cmd_name;
}

BIT8 ParseTestEntry ( BIT8 *entry, U_INT16 index )
{
    BIT8 *cmd_name;
    BIT8 *obj_name;
    BIT8 *setpt_name;
    BIT8 *value_name;
    pCMD_ENTRY cmd_ptr;
    U_INT16 cmd, obj, setpt, enum_type;
    INT32  ival;
    float  val;

    cmd_ptr = &Test_Buffer [ index ];

    cmd       = HALT;
    obj       = 255;
    setpt     = 255;
    enum_type = 0;
    val       = 0.0;
    ival      = 0;

    cmd_name   = GetNamePointer ( &entry );
    obj_name   = GetNamePointer ( &entry );
    setpt_name = GetNamePointer ( &entry );
    value_name = GetNamePointer ( &entry );

    if ( *cmd_name   != 0 )
    {
         cmd   = ResolveTagName ( cmd_name,   (pDEF)Cmd_Tags,   &enum_type  );
         if ( cmd == 0xffff ) return FALSE;
    }

    if ( enum_type == 1 )         /* next word must be a number */
    {
       value_name = obj_name;
       enum_type = 0;
    }
    else if ( enum_type == 2 )         /* next word must be an enumerated type  */
    {
       value_name = obj_name;
       if ( *value_name != 0 ) ival  = ResolveTagName ( value_name, (pDEF)Enum_Tags,  &enum_type  );
       if ( ival == 0 ) return FALSE;
    }
    else
    {
       if ( *obj_name   != 0 )
       {
            obj   = ResolveTagName ( obj_name,   (pDEF)Obj_Tags,   &enum_type  );
            if ( obj == 0xffff ) return FALSE;
       }

       if ( *setpt_name != 0 )
       {
            setpt = ResolveTagName ( setpt_name, (pDEF)Setpt_Tags, &enum_type  );
            if ( setpt == 0xffff ) return FALSE;
       }

       if ( *value_name != 0 )
       {
             ival  = ResolveTagName ( value_name, (pDEF)Enum_Tags,  &enum_type  );
       }
    }

    if ( enum_type != 0 )  /* was this a valid enum?  */
    {
       val = (float)ival;
    }
    else
    {
        if ( *value_name != 0 )
        {
            if ( (error = DecToInt( value_name,  3, &ival )) == OK )
            {
                val = (float)ival / 1000.0;
            }
            else
            {
                return FALSE;
            }
        }
    }


    cmd_ptr->bits.cmd_tag   = cmd;
    cmd_ptr->bits.obj       = obj;
    cmd_ptr->bits.setpt_tag = setpt;
    cmd_ptr->bits.enum_type = enum_type;
    cmd_ptr->value          = val;

    return TRUE;
}



float CallGet ( pCMD_ENTRY cmd, BIT8 data_comm )
{
    pFUNC_DESC Get;
    void   *func;
    void   *obj;
    U_INT8  num;
    U_INT32 val;

    Get  = (pFUNC_DESC) ( data_comm ? &Setpts[ cmd->bits.setpt_tag ].DcGet :  &Setpts[ cmd->bits.setpt_tag ].Get );

    func = Get->func_name;

    if ( func == NULL ) return -1;

    obj  = Object_Id[ cmd->bits.obj ].Obj_Ptr;
    num  = Object_Id[ cmd->bits.obj ].Obj_Num;
    val  = 0;

    switch ( Get->parm_size )
    {
    case 1: /* byte */

         switch ( Get->parm_ordering )
         {
         case None:      val = (*(GET_B   )(long)func)(  );
                         break;
         case Ptr:       val = (*(GET_B_P )(long)func)( obj );
                         break;
         case Ptr_Num:   val = (*(GET_B_PN)(long)func)( obj, num );
                         break;
         case Num_Ptr:   val = (*(GET_B_NP)(long)func)( num, obj );
                         break;
         }
         break;

    case 2: /* word */

         switch ( Get->parm_ordering )
         {
         case None:      val = (*(GET_W   )(long)func)(  );
                         break;
         case Ptr:       val = (*(GET_W_P )(long)func)( obj );
                         break;
         case Ptr_Num:   val = (*(GET_W_PN)(long)func)( obj, num );
                         break;
         case Num_Ptr:   val = (*(GET_W_NP)(long)func)( num, obj );
                         break;
         }
         break;

    case 4: /* long */

         switch ( Get->parm_ordering )
         {
         case None:      val = (*(GET_L   )(long)func)(  );
                         break;
         case Ptr:       val = (*(GET_L_P )(long)func)( obj );
                         break;
         case Ptr_Num:   val = (*(GET_L_PN)(long)func)( obj, num );
                         break;
         case Num_Ptr:   val = (*(GET_L_NP)(long)func)( num, obj );
                         break;
         }
         break;
    }


    return (float)val / ( data_comm ? Setpts [ cmd->bits.setpt_tag ].Dc_Scaling :
                                      Setpts [ cmd->bits.setpt_tag ].Scaling );

}

UI_ERR CallSet ( pCMD_ENTRY cmd, BIT8 data_comm, float val )
{
    pFUNC_DESC Set;
    void   *func;
    void   *obj;
    U_INT8  num;
    U_INT32 value;

    Set  = (pFUNC_DESC) ( data_comm ? &Setpts[ cmd->bits.setpt_tag ].DcSet :  &Setpts[ cmd->bits.setpt_tag ].Set );
    value = (U_INT32) (val * ( data_comm ? Setpts [ cmd->bits.setpt_tag ].Dc_Scaling :
                                           Setpts [ cmd->bits.setpt_tag ].Scaling ));

    func = Set->func_name;

    if ( func == NULL ) return NOT_ALLOWED;

    num  = Object_Id[ cmd->bits.obj ].Obj_Num;
    obj  = Object_Id[ cmd->bits.obj ].Obj_Ptr;


    switch ( Set->parm_size )
    {
    case 1: /* byte */

         switch ( Set->parm_ordering )
         {
         case Val:           error = (*(SET_B)(long)func)( value );
                             break;
         case Ptr:           error = (*(SET_P)(long)func)( obj   );
                             break;
         case Ptr_Val:       error = (*(SET_PB)(long)func)( obj, value );
                             break;
         case Val_Ptr:       error = (*(SET_BP)(long)func)( value , obj);
                             break;
         case Ptr_Val_Num:   error = (*(SET_PBN)(long)func)( obj,    value, num   );
                             break;
         case Ptr_Num_Val:   error = (*(SET_PNB)(long)func)( obj,    num,    value );
                             break;
         case Num_Ptr_Val:   error = (*(SET_NPB)(long)func)( num,   obj,     value );
                             break;
         case Val_Ptr_Num:   error = (*(SET_BPN)(long)func)( value,   obj,  num    );
                             break;
         case Val_Num_Ptr:   error = (*(SET_BNP)(long)func)( value, num,   obj     );
                             break;
         case Num_Val_Ptr:   error = (*(SET_NBP)(long)func)( num, value,   obj     );
                             break;
         }
         break;

    case 2: /* word */

         switch ( Set->parm_ordering )
         {
         case Val:           error = (*(SET_W)(long)func)( value );
                             break;
         case Ptr:           error = (*(SET_P)(long)func)( obj   );
                             break;
         case Ptr_Val:       error = (*(SET_PW)(long)func)( obj, value );
                             break;
         case Val_Ptr:       error = (*(SET_WP)(long)func)( value , obj);
                             break;
         case Ptr_Val_Num:   error = (*(SET_PWN)(long)func)( obj,    value, num   );
                             break;
         case Ptr_Num_Val:   error = (*(SET_PNW)(long)func)( obj,    num,    value );
                             break;
         case Num_Ptr_Val:   error = (*(SET_NPW)(long)func)( num,   obj,     value );
                             break;
         case Val_Ptr_Num:   error = (*(SET_WPN)(long)func)( value,   obj,  num    );
                             break;
         case Val_Num_Ptr:   error = (*(SET_WNP)(long)func)( value, num,   obj     );
                             break;
         case Num_Val_Ptr:   error = (*(SET_NWP)(long)func)( num, value,   obj     );
                             break;
         }
         break;

    case 4: /* long */

         switch ( Set->parm_ordering )
         {
         case Val:           error = (*(SET_L)(long)func)( value );
                             break;
         case Ptr:           error = (*(SET_P)(long)func)( obj   );
                             break;
         case Ptr_Val:       error = (*(SET_PL)(long)func)( obj, value );
                             break;
         case Val_Ptr:       error = (*(SET_LP)(long)func)( value , obj);
                             break;
         case Ptr_Val_Num:   error = (*(SET_PLN)(long)func)( obj,    value, num   );
                             break;
         case Ptr_Num_Val:   error = (*(SET_PNL)(long)func)( obj,    num,    value );
                             break;
         case Num_Ptr_Val:   error = (*(SET_NPL)(long)func)( num,   obj,     value );
                             break;
         case Val_Ptr_Num:   error = (*(SET_LPN)(long)func)( value,   obj,  num    );
                             break;
         case Val_Num_Ptr:   error = (*(SET_LNP)(long)func)( value, num,   obj     );
                             break;
         case Num_Val_Ptr:   error = (*(SET_NLP)(long)func)( num, value,   obj     );
                             break;
         }
         break;
    }

    ok  = (error == OK);

    return error;
}

void Get ( pCMD_ENTRY cmd, BIT8 data_comm )
{
   temp = CallGet( cmd, data_comm );
}

void GetA( pCMD_ENTRY cmd, BIT8 data_comm )
{
   a = CallGet( cmd, data_comm );
}

void GetB( pCMD_ENTRY cmd, BIT8 data_comm )
{
   b = CallGet( cmd, data_comm );
}

void GetC( pCMD_ENTRY cmd, BIT8 data_comm )
{
   c = CallGet( cmd, data_comm );
}

void GetD( pCMD_ENTRY cmd, BIT8 data_comm )
{
   d = CallGet( cmd, data_comm );
}

void Set( pCMD_ENTRY cmd, BIT8 data_comm )
{
   error = CallSet( cmd, data_comm, cmd->value );
}

void SetA( pCMD_ENTRY cmd, BIT8 data_comm )
{
   error = CallSet( cmd, data_comm, a );
}

void SetB( pCMD_ENTRY cmd, BIT8 data_comm )
{
   error = CallSet( cmd, data_comm, b );
}

void SetC( pCMD_ENTRY cmd, BIT8 data_comm )
{
   error = CallSet( cmd, data_comm, c );
}

void SetD( pCMD_ENTRY cmd, BIT8 data_comm )
{
   error = CallSet( cmd, data_comm, d );
}

void LoadA( pCMD_ENTRY cmd, BIT8 data_comm )
{
    a = cmd->value;

    (void) data_comm;
}

void LoadB( pCMD_ENTRY cmd, BIT8 data_comm )
{
    b = cmd->value;
    (void) data_comm;
}

void LoadC( pCMD_ENTRY cmd, BIT8 data_comm )
{
    c = cmd->value;
    (void) data_comm;
}

void LoadD( pCMD_ENTRY cmd, BIT8 data_comm )
{
    d = cmd->value;
    (void) data_comm;
}

void AddA ( pCMD_ENTRY cmd, BIT8 data_comm )
{
    a += cmd->value;
    (void) data_comm;
}

void AddB ( pCMD_ENTRY cmd, BIT8 data_comm )
{
    b += cmd->value;
    (void) data_comm;
}

void AddC ( pCMD_ENTRY cmd, BIT8 data_comm )
{
    c += cmd->value;
    (void) data_comm;
}

void AddD ( pCMD_ENTRY cmd, BIT8 data_comm )
{
    d += cmd->value;
    (void) data_comm;
}

void Test( pCMD_ENTRY cmd, BIT8 data_comm )
{
     test_num = cmd->value;
     test     = (U_INT16)(test_num * 1000.0 );
     step_num = 0;
     step     = 0;
    (void) data_comm;
}

U_INT8 CheckBounds( pCMD_ENTRY cmd, BIT8 data_comm )
{
    error = OK;

    temp = a - cmd->value;
    if ( (error = CallSet( cmd, data_comm, temp )) == OK )
    {
        return 1;
    }

    temp = a;
    if ( (error = CallSet( cmd, data_comm, temp )) != OK )
    {
        return 2;
    }

    temp = a + cmd->value;
    if ( (error = CallSet( cmd, data_comm, temp )) != OK )
    {
        return 3;
    }

    temp = (b-a)/2;
    if ( (error = CallSet( cmd, data_comm, temp )) != OK )
    {
        return 4;
    }

    temp = b - cmd->value;
    if ( (error = CallSet( cmd, data_comm, temp )) != OK )
    {
        return 5;
    }

    temp = b;
    if ( (error = CallSet( cmd, data_comm, temp )) != OK )
    {
        return 6;
    }

    temp = b + cmd->value;
    if ( (error = CallSet( cmd, data_comm, temp )) == OK )
    {
        return 7;
    }

    return 0;
}

void SetComparisonFlags ( pCMD_ENTRY cmd, BIT8 data_comm, float word, float ref )
{
   float difference;

   if ( data_comm )
   {
       difference =  ( word > ref ) ? word - ref : ref - word;
       if ( difference <=  ( Setpts [ cmd->bits.setpt_tag ].Dc_Modulo /Setpts [ cmd->bits.setpt_tag ].Dc_Scaling ))
       {
            eq = TRUE;
            ne = FALSE;
            lt = FALSE;
            gt = FALSE;
       }
       else if ( word > ref )
       {
            eq = FALSE;
            ne = TRUE;
            lt = TRUE;
            gt = FALSE;
       }
       else
       {
            eq = FALSE;
            ne = TRUE;
            lt = TRUE;
            gt = FALSE;
       }

   }
   else
   {
       eq   = ( word == ref );
       ne   = ( word != ref );
       lt   = ( word <  ref );
       gt   = ( word >  ref );
   }
}

void CmpAB( pCMD_ENTRY cmd, BIT8 data_comm )
{
   SetComparisonFlags ( cmd, data_comm, a, b );
}

void CmpI( pCMD_ENTRY cmd, BIT8 data_comm )
{
   float value;

   temp = CallGet( cmd, data_comm );

   if ( cmd->bits.enum_type == REGISTER_CLASS )
   {
       switch ( (U_INT16)cmd->value )
       {
           default:
           case RegA:  value = a;
                       break;
           case RegB:  value = b;
                       break;
           case RegC:  value = c;
                       break;
           case RegD:  value = d;
                       break;
       }
   }
   else
   {
       value = cmd->value;
   }

   SetComparisonFlags ( cmd, data_comm, temp, value );
}

void CmpA( pCMD_ENTRY cmd, BIT8 data_comm )
{
   temp = CallGet( cmd, data_comm );

   SetComparisonFlags ( cmd, data_comm, temp, a );
}

void CmpB( pCMD_ENTRY cmd, BIT8 data_comm )
{
   temp = CallGet( cmd, data_comm );

   SetComparisonFlags ( cmd, data_comm, temp, b );
}

void CmpC( pCMD_ENTRY cmd, BIT8 data_comm )
{
   temp = CallGet( cmd, data_comm );

   SetComparisonFlags ( cmd, data_comm, temp, c );
}

void CmpD( pCMD_ENTRY cmd, BIT8 data_comm )
{
   temp = CallGet( cmd, data_comm );

   SetComparisonFlags ( cmd, data_comm, temp, d );
}

#define EXEC   1
#define HALTED 2
#define SERR   3
#define DONE   4
#define BOUNDS 5



/**begin_proto**/

void DisplayMsg ( void )

/**end_proto**/
{
    BIT8 line1[21];
    BIT8 line2[21];
    BIT8 line3[21];
    BIT8 line4[21];

    BIT8 *pos;

    StrCopy( (BIT8 *)Pneu_Messages[  0], line2 );
    StrCopy( (BIT8 *)Pneu_Messages[  0], line3 );

    switch ( test_state )
    {
        case EXEC: StrCopy( (BIT8 *)Pneu_Messages[267], line1 );
                   break;
        case HALTED: StrCopy( (BIT8 *)Pneu_Messages[268], line1 );
                   break;
        case SERR: StrCopy( (BIT8 *)Pneu_Messages[269], line1 );
                   break;
        case DONE: StrCopy( (BIT8 *)Pneu_Messages[270], line1 );
                   break;
        case BOUNDS: StrCopy( (BIT8 *)Pneu_Messages[272], line1 );
                     FakeIntFormat ( (INT8)bounds, &line1[1] );
                   break;
    }

    FakeRealFormat( (U_INT32)(test_num * 1000), 1000, &line1[8] );
    FakeIntFormat ( step_num, &line1[12] );

    pos = line2;
    pos = FormatTag ( pos, script_ptr[ pc ].bits.cmd_tag,   0, (pDEF)Cmd_Tags );
    pos++;
    pos = FormatTag ( pos, script_ptr[ pc ].bits.obj,       0, (pDEF)Obj_Tags );

    pos = line3;
    pos = FormatTag ( pos, script_ptr[ pc ].bits.setpt_tag, 0, (pDEF)Setpt_Tags );

    if ( script_ptr[ pc ].bits.enum_type == 0 )
    {
       FakeRealFormat( (U_INT32)(script_ptr[ pc ].value * 1000), 1000, &line3[13] );
    }
    else
    {
       pos++;
       pos = FormatTag ( pos, (U_INT16)script_ptr[ pc ].value, script_ptr[ pc ].bits.enum_type, (pDEF)Enum_Tags );
       line3[20] = '\015';
    }

    StrCopy( (BIT8 *)Pneu_Messages[0], line4 );

    FakeRealFormat( (INT32)(a    * 1000.0), 1000, &line4[-1] );
    FakeRealFormat( (INT32)(b    * 1000.0), 1000, &line4[ 6] );
    FakeRealFormat( (INT32)(temp * 1000.0), 1000, &line4[13] );


    StopMonitor();
    BuildStringImage( line1, line2, line3, line4 );

    (void)test;
    (void)step;
}



/**begin_proto**/

void DisplayTestStatus ( void )

/**end_proto**/
{
    BIT8 line1[21];
    BIT8 line2[21];
    BIT8 line3[21];
    BIT8 line4[21];

    BIT8 *pos;

    StrCopy( (BIT8 *)Pneu_Messages[  0], line2 );
    StrCopy( (BIT8 *)Pneu_Messages[  0], line3 );
    StrCopy( (BIT8 *)Pneu_Messages[  0], line4 );

    switch ( test_state )
    {
        case EXEC: StrCopy( (BIT8 *)Pneu_Messages[267], line1 );
                   break;
        case HALTED: StrCopy( (BIT8 *)Pneu_Messages[268], line1 );
                   break;
        case SERR: StrCopy( (BIT8 *)Pneu_Messages[269], line1 );
                   break;
        case DONE: StrCopy( (BIT8 *)Pneu_Messages[270], line1 );
                   break;
        case BOUNDS: StrCopy( (BIT8 *)Pneu_Messages[272], line1 );
                     FakeIntFormat ( (INT8)bounds, &line1[1] );
                   break;
    }

    FakeRealFormat( (U_INT32)(test_num * 1000), 1000, &line1[8] );
    FakeIntFormat ( step_num, &line1[12] );

    pos = line2;
    pos = FormatTag ( pos, script_ptr[ pc ].bits.cmd_tag,   0, (pDEF)Cmd_Tags );
    pos++;
    pos = FormatTag ( pos, script_ptr[ pc ].bits.obj,       0, (pDEF)Obj_Tags );

    pos = line3;
    pos = FormatTag ( pos, script_ptr[ pc ].bits.setpt_tag, 0, (pDEF)Setpt_Tags );

    if ( script_ptr[ pc ].bits.enum_type == 0 )
    {
       FakeRealFormat( (U_INT32)(script_ptr[ pc ].value * 1000), 1000, &line4[ 1] );
    }
    else
    {
       pos = line4;
       pos = FormatTag ( pos, (U_INT16)script_ptr[ pc ].value, script_ptr[ pc ].bits.enum_type, (pDEF)Enum_Tags );
       line4[20] = '\015';
    }




    StopMonitor();
    BuildStringImage( line1, line2, line3, line4 );

    (void)test;
    (void)step;
}


/**begin_proto**/

void DisplayTestRegs ( void )

/**end_proto**/
{
    BIT8 line1[21];
    BIT8 line2[21];
    BIT8 line3[21];
    BIT8 line4[21];

    BIT8 *pos;

    StrCopy( (BIT8 *)Pneu_Messages[273], line1 );
    StrCopy( (BIT8 *)Pneu_Messages[274], line2 );
    StrCopy( (BIT8 *)Pneu_Messages[275], line3 );
    StrCopy( (BIT8 *)Pneu_Messages[  0], line4 );

    FakeRealFormat( (INT32)(a    * 1000.0), 1000, &line1[ 2] );
    FakeRealFormat( (INT32)(c    * 1000.0), 1000, &line1[12] );
    FakeRealFormat( (INT32)(b    * 1000.0), 1000, &line2[ 2] );
    FakeRealFormat( (INT32)(d    * 1000.0), 1000, &line2[12] );
    FakeRealFormat( (INT32)(temp * 1000.0), 1000, &line3[ 2] );
    FakeIntFormat ( error, &line3[12] );

    if ( script_ptr[ pc ].bits.enum_type != 0 )
    {
       pos = line4;
       pos = FormatTag ( pos, (U_INT16)temp, script_ptr[ pc ].bits.enum_type, (pDEF)Enum_Tags );
       line4[20] = '\015';
    }

    StopMonitor();
    BuildStringImage( line1, line2, line3, line4 );

    (void)test;
    (void)step;
}



/**begin_proto**/

void  ExecTestCmdEntry ( void )

/**end_proto**/
{

       U_INT16 i;
static BIT8    data_comm;
static BIT8    slow;


         if ( slow ) for( i = 0 ; i < 250 ; i ++ ) Task_yield();

         switch ( script_ptr[ pc ].bits.cmd_tag )
         {
         case  DATACOMM:       data_comm = 1;
                               break;
         case  KEY_BOARD:      data_comm = 0;
                               break;
         case  EXEC_SLOW:      slow = 1;
                               break;
         case  EXEC_FAST:      slow = 0;
                               break;
         case  TEST:           Test( &script_ptr [ pc ], data_comm );
                               break;
         case  SET:            Set( &script_ptr [ pc ], data_comm );
                               break;
         case  SETA:           SetA( &script_ptr [ pc ], data_comm );
                               break;
         case  SETB:           SetB( &script_ptr [ pc ], data_comm );
                               break;
         case  SETC:           SetC( &script_ptr [ pc ], data_comm );
                               break;
         case  SETD:           SetD( &script_ptr [ pc ], data_comm );
                               break;
         case  GET:            Get( &script_ptr [ pc ], data_comm );
                               break;
         case  GETA:           GetA( &script_ptr [ pc ], data_comm );
                               break;
         case  GETB:           GetB( &script_ptr [ pc ], data_comm );
                               break;
         case  GETC:           GetC( &script_ptr [ pc ], data_comm );
                               break;
         case  GETD:           GetD( &script_ptr [ pc ], data_comm );
                               break;
         case  CMPAB:          CmpAB( &script_ptr [ pc ], data_comm );
                               break;
         case  CMP:            CmpI( &script_ptr [ pc ], data_comm );
                               break;
         case  CMPI:           CmpI( &script_ptr [ pc ], data_comm );
                               if ( ne )
                               {
                                   test_state = HALTED;
                                   DisplayMsg( );
                                   return;
                               }
                               break;
         case  CMP_NEG_I:      CmpI( &script_ptr [ pc ], data_comm );
                               if ( eq )
                               {
                                   test_state = HALTED;
                                   DisplayMsg( );
                                   return;
                               }
                               break;
         case  CMPA:           CmpA( &script_ptr [ pc ], data_comm );
                               break;
         case  CMPB:           CmpB( &script_ptr [ pc ], data_comm );
                               break;
         case  CMPC:           CmpC( &script_ptr [ pc ], data_comm );
                               break;
         case  CMPD:           CmpD( &script_ptr [ pc ], data_comm );
                               break;
         case  LOADA:          LoadA( &script_ptr [ pc ], data_comm );
                               break;
         case  LOADB:          LoadB( &script_ptr [ pc ], data_comm );
                               break;
         case  LOADC:          LoadC( &script_ptr [ pc ], data_comm );
                               break;
         case  LOADD:          LoadD( &script_ptr [ pc ], data_comm );
                               break;
         case  ADDA:           AddA( &script_ptr [ pc ], data_comm );
                               break;
         case  ADDB:           AddB( &script_ptr [ pc ], data_comm );
                               break;
         case  ADDC:           AddC( &script_ptr [ pc ], data_comm );
                               break;
         case  ADDD:           AddD( &script_ptr [ pc ], data_comm );
                               break;
         case  IFEQ:           if ( !eq )
                               {
                                  step_num++;
                                  step++;
                                  pc++;
                               }
                               break;
         case  IFNE:           if ( !ne )
                               {
                                  step_num++;
                                  step++;
                                  pc++;
                               }
                               break;
         case  IFGT:           if ( !gt )
                               {
                                  step_num++;
                                  step++;
                                  pc++;
                               }
                               break;
         case  IFLT:           if ( !lt )
                               {
                                  step_num++;
                                  step++;
                                  pc++;
                               }
                               break;
         case  IFOK:           if ( !ok )
                               {
                                  step_num++;
                                  step++;
                                  pc++;
                               }
                               break;
         case  IFNOTOK:        if ( ok  )
                               {
                                  step_num++;
                                  step++;
                                  pc++;
                               }
                               break;

         case  LOAD_METH:      error =LoadMethod ( (U_INT8)script_ptr [ pc ].value );
                               ok = ( error == OK );
                               break;
         case  SAVE_METH:      error = StoreMethod ( (U_INT8)script_ptr [ pc ].value );
                               ok = ( error == OK );
                               break;
         case  CHECK_METH:     error = CheckMethod ( (U_INT8)script_ptr [ pc ].value );
                               ok = ( error == OK );
                               break;

         case  TEST_EXCEPT:    temp = (float)TestForException ( (EXCEPTION)script_ptr [ pc ].value );
                               ok = ( TestForException ( (EXCEPTION)script_ptr [ pc ].value ) == FALSE );
                               eq = ( TestForException ( (EXCEPTION)script_ptr [ pc ].value ) == FALSE );
                               break;

         case  GOTO_TEST:      i = 0;
                               while ( 1 )
                               {
                                   if (( script_ptr[ i ].bits.cmd_tag == TEST ) &&
                                       ( script_ptr[ i ].value == script_ptr[ pc].value ))
                                   {
                                       Test ( &script_ptr[ i ], data_comm );
                                       pc = i;
                                       break;
                                   }
                                   if ( script_ptr[ i ].bits.cmd_tag == END )
                                   {
                                       test_state = HALTED;
                                       DisplayMsg( );
                                       return;
                                   }
                                   i++;
                               }

                               break;
         default:
         case  HALT:           test_state = HALTED;
                               DisplayMsg( );
                               return;
         case  HALT_IF_EQ:     if ( eq )
                               {
                                    test_state = HALTED;
                                    DisplayMsg( );
                                    return;
                               }
                               break;
         case  HALT_IF_NE:     if ( ne )
                               {
                                    test_state = HALTED;
                                    DisplayMsg( );
                                    return;
                               }
                               break;
         case  HALT_IF_OK:     if ( ok )
                               {
                                    test_state = HALTED;
                                    DisplayMsg( );
                                    return;
                               }
                               break;
         case  HALT_IF_NOK:    if ( !ok )
                               {
                                    test_state = HALTED;
                                    DisplayMsg( );
                                    return;
                               }
                               break;
         case  CHECK_BOUNDS:   if (( bounds = CheckBounds ( &script_ptr [ pc ], data_comm )) != 0 )
                               {
                                  test_state = BOUNDS;
                                  DisplayMsg();
                                  return;
                               }
                               break;
         case  IGNORE_ERRORS:  ignore = 1;
                               break;
         case  TRAP_ERRORS:    ignore = 0;
                               error = OK;
                               break;
         case  WAIT:           for( i = 0 ; i < 500 ; i ++ ) Task_yield();
                               break;

         case  START:          (void)StartRun();
                               break;
         case  STOP:           StopRun( (STOP_RUN_REASON) script_ptr [ pc ].value );
                               break;
         case  PREPARE:        Prepare( (INVOCATION_MODE) script_ptr [ pc ].value );
                               break;

         }


         if (( error != OK ) && ( ignore != 1 ))
         {
             test_state = SERR;
             DisplayMsg(  );
             return;
         }

         if ( (script_ptr[ pc ].bits.cmd_tag) == END )
         {
             test_state = DONE;
             DisplayMsg( );
             return;
         }

         DisplayMsg ( );

         pc++;
         step_num++;
         step++;

         SendExecTestCmdRequest( );
}

/**end_proto**/


void InterpretTestScript ( pCMD_ENTRY script )
{
     if ( test_state == EXEC ) return; /* already running */

     INTERRUPTS_OFF

     test_state = EXEC;
     script_ptr = script;
     error      = OK;
     test_num   = 0;
     step_num   = 0;
     pc         = 0;

     SendExecTestCmdRequest( );

     INTERRUPTS_ON

}


void RestartTestScript ( )
{
     if ( test_state != HALTED ) return; /* not paused */

     INTERRUPTS_OFF

     test_state = EXEC;
     error      = OK;

     SendExecTestCmdRequest( );

     INTERRUPTS_ON

}


void TestIt( void )
{
     InterpretTestScript( (pCMD_ENTRY)Test_Buffer );
}

#endif
